Class SimpleValue

  • All Implemented Interfaces:
    Value

    public class SimpleValue
    extends Object
    implements Value
    Wraps a value from a data source such as a CSV to simplify conversion to typed values.
    Version:
    $Revision: $
    Author:
    Dave Reynolds
    • Constructor Detail

      • SimpleValue

        public SimpleValue​(String lexicalForm)
      • SimpleValue

        public SimpleValue​(Object value)
    • Method Detail

      • getLexical

        public String getLexical()
        Description copied from interface: Value
        Original lexical form for the value
        Specified by:
        getLexical in interface Value
      • asInt

        public long asInt()
        Description copied from interface: Value
        Return value as a (long) int if possible, otherwise ModalException
        Specified by:
        asInt in interface Value
      • isInt

        public boolean isInt()
        Description copied from interface: Value
        Test if the value can be treated as a (long) int
        Specified by:
        isInt in interface Value
      • getValue

        public Object getValue()
        Description copied from interface: Value
        Return the value unconverted. For CVS source data this will be the lexical form. For values injected by other sources may be any java Object including boxed Integers etc
        Specified by:
        getValue in interface Value
      • notEmpty

        public boolean notEmpty()
        Description copied from interface: Value
        Return true if the value is non-null and not an empty string
        Specified by:
        notEmpty in interface Value
      • empty

        public boolean empty()
        Description copied from interface: Value
        Return true unless the value is null or an empty string
        Specified by:
        empty in interface Value
      • str

        public String str()
        Description copied from interface: Value
        Original lexical form for the value, Ruby-friendly alias
        Specified by:
        str in interface Value