Class ConverterBuilderImpl

    • Constructor Detail

    • Method Detail

      • build

        public InternalConverter build()
        Description copied from interface: ConverterBuilder
        Build the specified converter. Each time this method is called a new custom converter is produced based on the rules registered with the builder.
        Specified by:
        build in interface ConverterBuilder
        Returns:
        A new converter with the rules provided to the builder.
      • errorHandler

        public ConverterBuilder errorHandler​(ConverterFunction func)
        Description copied from interface: ConverterBuilder
        Register a custom error handler. The custom error handler will be called when the conversion would otherwise throw an exception. The error handler can either throw a different exception or return a value to be used for the failed conversion.
        Specified by:
        errorHandler in interface ConverterBuilder
        Parameters:
        func - The function to be used to handle errors.
        Returns:
        This converter builder for further building.
      • rule

        public ConverterBuilder rule​(ConverterFunction func)
        Description copied from interface: ConverterBuilder
        Register a catch-all rule, will be called of no other rule matches.
        Specified by:
        rule in interface ConverterBuilder
        Parameters:
        func - The function that will handle the conversion.
        Returns:
        This converter builder for further building.
      • rule

        public ConverterBuilder rule​(java.lang.reflect.Type t,
                                     ConverterFunction func)
        Description copied from interface: ConverterBuilder
        Register a conversion rule for this converter. Note that only the target type is specified, so the rule will be visited for every conversion to the target type.
        Specified by:
        rule in interface ConverterBuilder
        Parameters:
        t - The type that this rule will produce.
        func - The function that will handle the conversion.
        Returns:
        This converter builder for further building.
      • getRulesList

        private java.util.List<ConverterFunction> getRulesList​(java.lang.reflect.Type type)