Class Entity.Builder

Enclosing class:
Entity

public static class Entity.Builder extends BaseAttribute.Builder<Entity,Entity.Builder>
A builder for resolved entities.
  • Constructor Details

    • Builder

      public Builder()
      Constructs a builder from the required values.
    • Builder

      public Builder(Entity toCopy)
      Constructs a builder by copying values from an existing resolved entity.
      Parameters:
      toCopy - the object to create
  • Method Details

    • entityId

      public Entity.Builder entityId(String entityId)
      Specifies the entity unique ID.
      Parameters:
      entityId - the ID
      Returns:
      this
    • mention

      public Entity.Builder mention(Mention mention)
      Add one mention to the mentions.
      Parameters:
      mention - the mention.
      Returns:
      this.
    • headMentionIndex

      public Entity.Builder headMentionIndex(Integer headMentionIndex)
      Specifies the index of the head mention in the list of mentions, if any.
      Parameters:
      headMentionIndex - the index.
      Returns:
      this.
    • confidence

      public Entity.Builder confidence(Double confidence)
      Specifies the confidence value of the resolved entity.
      Parameters:
      confidence - the confidence value
      Returns:
      this
    • sentiment

      public Entity.Builder sentiment(CategorizerResult sentiment)
      Specifies the sentiment.
      Parameters:
      sentiment - the sentiment
      Returns:
      this
    • type

      public Entity.Builder type(String type)
      Specify the type for this entity.
      Parameters:
      type - the type
      Returns:
      this
    • salience

      public Entity.Builder salience(Double salience)
      Specify the salience for this entity.
      Parameters:
      salience - salience value.
      Returns:
      this
    • build

      public Entity build()
      Returns an immutable resolved entity from the current state of the builder.
      Returns:
      the new resolved entity
    • getThis

      protected Entity.Builder getThis()
      Specified by:
      getThis in class BaseAttribute.Builder<Entity,Entity.Builder>