Class CustomClassRules.Builder

java.lang.Object
com.microblink.blinkid.entities.recognizers.blinkid.generic.CustomClassRules.Builder
Enclosing class:
CustomClassRules

public static class CustomClassRules.Builder extends Object
Builder for CustomClassRules.
  • Constructor Details

    • Builder

      public Builder(@NonNull DetailedFieldType[] detailedFieldTypes) throws IllegalArgumentException
      Constructs a new builder with the provided detailed field types as they are mandatory for creating a custom class rule.
      Parameters:
      detailedFieldTypes - array of detailed field types that are mandatory for the document class
      Throws:
      IllegalArgumentException - if detailedFieldTypes is null or empty
  • Method Details

    • build

      public CustomClassRules build()
      Builds CustomClassRules from the provided arguments.
      Returns:
      built CustomClassRules
    • setCountry

      public CustomClassRules.Builder setCountry(@Nullable Country country)
      Sets the country of the document class. If set, rules will be applied on documents issued by specified country only. Otherwise, or if set to null, issuing country will not be taken into account. Setting the country to Type.NONE has no effect.
      Parameters:
      country - country of the document class
      Returns:
      this builder
    • setRegion

      public CustomClassRules.Builder setRegion(@Nullable Region region)
      Sets the region of the document class. If set, rules will be applied on documents issued by specified region only. Otherwise, or if set to null, issuing region will not be taken into account. If set to Region.NONE, the rules will be applied only to the default region (for example, Croatia has no regions, so the rules will be applied to all documents issued in Croatia, but if country is set to the USA, the documents that have a region will be excluded from the rules).
      Parameters:
      region - region of the document class
      Returns:
      this builder
    • setType

      public CustomClassRules.Builder setType(@Nullable Type type)
      Sets the type of the document class. If set, rules will be applied on documents of specified type only. Otherwise, or if set to null, document type will not be taken into account. Setting the type to Type.NONE has no effect.
      Parameters:
      type - type of the document class
      Returns:
      this builder