Package com.mindee.parsing.v2.field
Class DynamicField
- java.lang.Object
-
- com.mindee.parsing.v2.field.DynamicField
-
public class DynamicField extends Object
Dynamically-typed field (simple / object / list).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDynamicField.FieldTypePossible field kinds.
-
Constructor Summary
Constructors Constructor Description DynamicField()DynamicField(DynamicField.FieldType type, SimpleField simpleField, ListField listField, ObjectField objectField)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)<T extends BaseField>
TgetField(Class<T> type)Returns the field as the specified class.ListFieldgetListField()ObjectFieldgetObjectField()SimpleFieldgetSimpleField()DynamicField.FieldTypegetType()Type of the wrapped field.inthashCode()static DynamicFieldof(ListField value)static DynamicFieldof(ObjectField value)static DynamicFieldof(SimpleField value)StringtoString()
-
-
-
Constructor Detail
-
DynamicField
public DynamicField(DynamicField.FieldType type, SimpleField simpleField, ListField listField, ObjectField objectField)
-
DynamicField
public DynamicField()
-
-
Method Detail
-
of
public static DynamicField of(SimpleField value)
-
of
public static DynamicField of(ObjectField value)
-
of
public static DynamicField of(ListField value)
-
getSimpleField
public SimpleField getSimpleField() throws IllegalStateException
- Throws:
IllegalStateException
-
getListField
public ListField getListField() throws IllegalStateException
- Throws:
IllegalStateException
-
getObjectField
public ObjectField getObjectField() throws IllegalStateException
- Throws:
IllegalStateException
-
getField
public <T extends BaseField> T getField(Class<T> type) throws IllegalArgumentException
Returns the field as the specified class.- Type Parameters:
T- the type of field to return- Parameters:
type- the class representing the desired field type- Throws:
IllegalArgumentException- if the requested type is not SimpleField, ListField, or ObjectFieldIllegalStateException- if the field's internal type does not match the requested type
-
getType
public DynamicField.FieldType getType()
Type of the wrapped field.
-
canEqual
protected boolean canEqual(Object other)
-
-