Package com.mindee.parsing.v2.field
Class SimpleField
- java.lang.Object
-
- com.mindee.parsing.v2.field.BaseField
-
- com.mindee.parsing.v2.field.SimpleField
-
public final class SimpleField extends BaseField
Field holding a single scalar value.
-
-
Constructor Summary
Constructors Constructor Description SimpleField(Object value, FieldConfidence confidence, List<FieldLocation> locations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
Boolean
getBooleanValue()
Retrieves the value of the field as a Boolean.Double
getDoubleValue()
Retrieves the value of the field as a Double.String
getStringValue()
Retrieves the value of the field as a string.Object
getValue()
Value (string, boolean, double, ornull
).int
hashCode()
String
toString()
-
Methods inherited from class com.mindee.parsing.v2.field.BaseField
getConfidence, getLocations, setConfidence, setLocations
-
-
-
-
Constructor Detail
-
SimpleField
public SimpleField(Object value, FieldConfidence confidence, List<FieldLocation> locations)
-
-
Method Detail
-
getStringValue
public String getStringValue() throws ClassCastException
Retrieves the value of the field as a string.- Returns:
- the field value as a string
- Throws:
ClassCastException
- if the value cannot be cast to a string
-
getDoubleValue
public Double getDoubleValue() throws ClassCastException
Retrieves the value of the field as a Double.- Returns:
- the field value as a Double
- Throws:
ClassCastException
- if the value cannot be cast to a Double
-
getBooleanValue
public Boolean getBooleanValue() throws ClassCastException
Retrieves the value of the field as a Boolean.- Returns:
- the field value as a Boolean
- Throws:
ClassCastException
- if the value cannot be cast to a Boolean
-
getValue
public Object getValue()
Value (string, boolean, double, ornull
).
-
-