Class BaseAttribute

java.lang.Object
com.basistech.rosette.dm.BaseAttribute
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Attribute, CategorizerResult, Concept, Dependency, Embeddings, Entity, Event, Keyphrase, LanguageDetection.DetectionResult, ListAttribute, MapAttribute, MorphoAnalysis, Name, RelationshipComponent, SimilarTerm, TranslatedData, TranslatedTokens, Transliteration, TransliterationResults, UnknownAttribute

public abstract class BaseAttribute extends Object implements Serializable
Base class for attributes that annotate text.

Each attribute contains an extended properties map of String to Object to hold optional "user-defined" elements. An extended property key should be prefixed with a reversed domain name, e.g. "com.example.key". Keys that are valid Java identifiers are reserved for use by Basis Technology.

See Also:
  • Field Details

  • Constructor Details

    • BaseAttribute

      protected BaseAttribute()
    • BaseAttribute

      protected BaseAttribute(Map<String,Object> extendedProperties)
  • Method Details

    • getExtendedProperties

      public Map<String,Object> getExtendedProperties()
      Returns the extended properties. All attributes store a map of extended properties. This mechanism is available to add additional data to attributes.
      Returns:
      the map of extended properties
    • setExtendedProperty

      protected void setExtendedProperty(String name, Object value)
      Called only from Jackson to implement deserialization via JsonAnySetter.
      Parameters:
      name - property name
      value - property value
    • toStringHelper

      protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • listOrNull

      protected static <T> List<T> listOrNull(List<T> listToBuild)
      Utility method for the 'no empty lists' convention. Takes a list, if empty returns null, else returns a copy of the list. Use this in constructors of the the immutable objects, not in their builders.
      Type Parameters:
      T - the type of the list
      Parameters:
      listToBuild - the list
      Returns:
      a list, or null.