Class LongTransformer

  • All Implemented Interfaces:
    Transformer, Validator

    public class LongTransformer
    extends AbstractIntegerTransformer<Long>

    A specialized number transformer implementation that deals with numbers of type java.lang.Long.

    This class implements the abstract methods defined by its super classes in a way suitable for java.lang.Long objects. It does not define any new properties or error messages. Refer to the documentation of NumberTransformerBase for a list of all supported properties and possible error messages.

    Version:
    $Id: LongTransformer.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • LongTransformer

        public LongTransformer()
    • Method Detail

      • convert

        protected Long convert​(Number n)
        Converts the given number into a Long. This implementation also checks whether the number fits into the value range of Long and throws an IllegalArgumentException if not.
        Specified by:
        convert in class NumberTransformerBase<Long>
        Parameters:
        n - the number to convert
        Returns:
        the converted number
        Throws:
        IllegalArgumentException - if the number cannot be converted to a Long
      • fetchProperty

        protected Long fetchProperty​(org.apache.commons.configuration.Configuration config,
                                     String property,
                                     Long defaultValue)
        Fetches a long property from the specified configuration.
        Specified by:
        fetchProperty in class NumberTransformerBase<Long>
        Parameters:
        config - the configuration
        property - the property
        defaultValue - the default value
        Returns:
        the value of this property