Package com.mindee.parsing.generated
Class GeneratedFeature
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<GeneratedObject>
-
- com.mindee.parsing.generated.GeneratedFeature
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<GeneratedObject>
,Collection<GeneratedObject>
,List<GeneratedObject>
,RandomAccess
public class GeneratedFeature extends ArrayList<GeneratedObject>
A generic feature which can represent any OTS Mindee return prediction.
The Mindee API can return either lists or objects. Here we represent all features as a list, to simplify any code that interacts with this class.
If you want, you can "cast" the raw hashmap into one of the standard Mindee fields:
- StringField - asStringField()
- AmountField - asAmountField()
- DateField - asDateField()
- ClassificationField - asClassificationField()
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description GeneratedFeature(boolean isList)
Whether the original feature is a list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AmountField
asAmountField()
Represent the feature as a standardAmountField
.ClassificationField
asClassificationField()
Represent the feature as a standardClassificationField
.DateField
asDateField()
Represent the feature as a standardDateField
.StringField
asStringField()
Represent the feature as a standardStringField
.boolean
isList()
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
asStringField
public StringField asStringField()
Represent the feature as a standardStringField
. Only works for non-list features.
-
asAmountField
public AmountField asAmountField()
Represent the feature as a standardAmountField
. Only works for non-list features.
-
asDateField
public DateField asDateField()
Represent the feature as a standardDateField
. Only works for non-list features.
-
asClassificationField
public ClassificationField asClassificationField()
Represent the feature as a standardClassificationField
. Only works for non-list features.
-
isList
public boolean isList()
-
-