Package com.microblink.blinkid.entities.recognizers.blinkid.generic

# Class ClassAnonymizationSettings.Builder

java.lang.Object
com.microblink.blinkid.entities.recognizers.blinkid.generic.ClassAnonymizationSettings.Builder

Enclosing class:
  ClassAnonymizationSettings

public static class ClassAnonymizationSettings.Builder extends Object
Only specified parameters will be taken into account during anonymization. If any of the parameters are left undefined or set to `null`, specific anonymization will be applied to all the members of that parameter. `FieldType` array has to be set. Empty array is allowed.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder(FieldType[] fields)`
  Constructs a new `ClassAnonymizationSettings.Builder` instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ClassAnonymizationSettings`
  `build()`
  Builds `ClassAnonymizationSettings` from the specified parameters.
  `ClassAnonymizationSettings.Builder`
  `setCountry(Country country)`
  If set, specified fields will be anonymized on documents issued by specified country only.
  `ClassAnonymizationSettings.Builder`
  `setDocumentNumberAnonymizationSettings(DocumentNumberAnonymizationSettings documentNumberAnonymizationSettings)`
  If set, the first and the last digits of document number will be shown according to values in `DocumentNumberAnonymizationSettings`.
  `ClassAnonymizationSettings.Builder`
  `setRegion(Region region)`
  If set, specified fields will be anonymized on documents issued by specified region only.
  `ClassAnonymizationSettings.Builder`
  `setType(Type type)`
  If set, specified fields will be anonymized on documents of specified type only.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder(@NonNull FieldType[] fields) throws IllegalArgumentException
    Constructs a new `ClassAnonymizationSettings.Builder` instance. `FieldType` array has to be set, even if empty. Otherwise, `IllegalArgumentException` will be thrown.
    Parameters:
      `fields` - fields to be anonymized
    Throws:
      `IllegalArgumentException` - if the passed `fields` array is `null`

- ## Method Details

  - ### build

    public ClassAnonymizationSettings build()
    Builds `ClassAnonymizationSettings` from the specified parameters.
    Returns:
      built `ClassAnonymizationSettings`

  - ### setCountry

    public ClassAnonymizationSettings.Builder setCountry(@Nullable Country country)
    If set, specified fields will be anonymized on documents issued by specified country only. Otherwise, issuing country will not be taken into account during anonymization.
    Parameters:
      `country` - country to be set
    Returns:
      this builder

  - ### setRegion

    public ClassAnonymizationSettings.Builder setRegion(@Nullable Region region)
    If set, specified fields will be anonymized on documents issued by specified region only. Otherwise, issuing region will not be taken into account during anonymization.
    Parameters:
      `region` - region to be set
    Returns:
      this builder

  - ### setType

    public ClassAnonymizationSettings.Builder setType(@Nullable Type type)
    If set, specified fields will be anonymized on documents of specified type only. Otherwise, document type will not be taken into account during anonymization.
    Parameters:
      `type` - type to be set
    Returns:
      this builder

  - ### setDocumentNumberAnonymizationSettings

    public ClassAnonymizationSettings.Builder setDocumentNumberAnonymizationSettings(@Nullable DocumentNumberAnonymizationSettings documentNumberAnonymizationSettings)
    If set, the first and the last digits of document number will be shown according to values in `DocumentNumberAnonymizationSettings`.
    Parameters:
      `documentNumberAnonymizationSettings` - documentNumberAnonymizationSettings to be set
    Returns:
      this builder