Class 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()
    This will not work for any feature which is a list in the Mindee return.
    See Also:
    Serialized Form
    • Constructor Detail

      • GeneratedFeature

        public GeneratedFeature​(boolean isList)
        Whether the original feature is a list.
    • Method Detail

      • asStringField

        public StringField asStringField()
        Represent the feature as a standard StringField. Only works for non-list features.
      • asAmountField

        public AmountField asAmountField()
        Represent the feature as a standard AmountField. Only works for non-list features.
      • asDateField

        public DateField asDateField()
        Represent the feature as a standard DateField. Only works for non-list features.
      • isList

        public boolean isList()