Package com.epimorphics.converters
Class SimpleValue
- java.lang.Object
-
- com.epimorphics.converters.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 Summary
Constructors Constructor Description SimpleValue(Object value)SimpleValue(String lexicalForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longasInt()Return value as a (long) int if possible, otherwise ModalExceptionbooleanempty()Return true unless the value is null or an empty stringStringgetLexical()Original lexical form for the valueObjectgetValue()Return the value unconverted.booleanisInt()Test if the value can be treated as a (long) intbooleannotEmpty()Return true if the value is non-null and not an empty stringStringstr()Original lexical form for the value, Ruby-friendly aliasStringtoString()
-
-
-
Method Detail
-
getLexical
public String getLexical()
Description copied from interface:ValueOriginal lexical form for the value- Specified by:
getLexicalin interfaceValue
-
asInt
public long asInt()
Description copied from interface:ValueReturn value as a (long) int if possible, otherwise ModalException
-
isInt
public boolean isInt()
Description copied from interface:ValueTest if the value can be treated as a (long) int
-
getValue
public Object getValue()
Description copied from interface:ValueReturn 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
-
notEmpty
public boolean notEmpty()
Description copied from interface:ValueReturn true if the value is non-null and not an empty string
-
empty
public boolean empty()
Description copied from interface:ValueReturn true unless the value is null or an empty string
-
-