Package com.microblink.blinkid.entities

# Class Entity<T extends Entity.Result>

java.lang.Object
com.microblink.blinkid.entities.Entity<T>

All Implemented Interfaces:
  `android.os.Parcelable`

Direct Known Subclasses:
  `Processor`, `Recognizer`

public abstract class Entity<T extends Entity.Result> extends Object implements android.os.Parcelable
Represents an entity that can be process a step during recognition.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `Entity.Result`

  ## Nested classes/interfaces inherited from interface android.os.Parcelable

  `android.os.Parcelable.ClassLoaderCreator<T extends Object>, android.os.Parcelable.Creator<T extends Object>`

- ## Field Summary

  ### Fields inherited from interface android.os.Parcelable

  `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Entity(long nativeEntity, T result)`
  `protected`
  `Entity(long nativeEntity, T result, android.os.Parcel in)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Entity`
  `clone()`
  Create a copy of the entity.
  `abstract void`
  `consumeResultFrom(Entity other)`
  Consume result from other entity.
  `int`
  `describeContents()`
  `protected abstract void`
  `deserializeNativeSettings(byte[] serializedSettings)`
  `protected void`
  `finalize()`
  `final long`
  `getNativeContext()`
  `final T`
  `getResult()`
  Returns the last result of the entity.
  `protected static long`
  `nativeGetNativeResultContext(long nativeContext)`
  `protected void`
  `readFromParcel(android.os.Parcel in)`
  `protected abstract byte[]`
  `serializeNativeSettings()`
  `protected abstract void`
  `terminateNative(long nativeContext)`
  `void`
  `writeToParcel(android.os.Parcel dest, int i)`

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

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

- ## Constructor Details

  - ### Entity

    protected Entity(long nativeEntity, @NonNull T result)

  - ### Entity

    protected Entity(long nativeEntity, @NonNull T result, @NonNull android.os.Parcel in)

- ## Method Details

  - ### nativeGetNativeResultContext

    protected static long nativeGetNativeResultContext(long nativeContext)

  - ### finalize

    protected void finalize() throws Throwable
    Overrides:
      `finalize` in class `Object`
    Throws:
      `Throwable`

  - ### describeContents

    public int describeContents()
    Specified by:
      `describeContents` in interface `android.os.Parcelable`

  - ### getNativeContext

    public final long getNativeContext()

  - ### terminateNative

    protected abstract void terminateNative(long nativeContext)

  - ### serializeNativeSettings

    @Nullable protected abstract byte[] serializeNativeSettings()

  - ### deserializeNativeSettings

    protected abstract void deserializeNativeSettings(@NonNull byte[] serializedSettings)

  - ### clone

    @NonNull public abstract Entity clone()
    Create a copy of the entity. This is required if properties of the entity must be modified while background thread performs processing. In order to avoid race conditions, changing properties is not allowed while entity is used in background processing. However, you are able to make a copy of the entity, change properties of it and then update the `RecognizerRunnerView` or `RecognizerRunner` with the updated entity hierarchy.
    Overrides:
      `clone` in class `Object`
    Returns:
      a copy of the entity

  - ### consumeResultFrom

    public abstract void consumeResultFrom(@NonNull Entity other)
    Consume result from other entity. The result from other will be put instead current result of this entity. This method is used inside `BaseIntentTransferable.loadFromIntent(Intent)` and similar methods to replace the result content of the saved entities with results that have arrived over `Intent`
    Parameters:
      `other` - Entity from which result should be consumed.

  - ### writeToParcel

    @CallSuper public void writeToParcel(@NonNull android.os.Parcel dest, int i)
    Specified by:
      `writeToParcel` in interface `android.os.Parcelable`

  - ### readFromParcel

    @CallSuper protected void readFromParcel(@NonNull android.os.Parcel in)

  - ### getResult

    @NonNull public final T getResult()
    Returns the last result of the entity.
    Returns:
      the last result of the entity.