Package com.basistech.rosette.dm
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
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
BaseAttribute.Builder<T extends BaseAttribute,
B extends BaseAttribute.Builder<T, B>> Base class for builders for the subclasses ofBaseAttribute
. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
BaseAttribute
(Map<String, Object> extendedProperties) -
Method Summary
Modifier and TypeMethodDescriptionReturns the extended properties.protected static <T> List<T>
listOrNull
(List<T> listToBuild) Utility method for the 'no empty lists' convention.protected void
setExtendedProperty
(String name, Object value) Called only from Jackson to implement deserialization via JsonAnySetter.toString()
protected com.google.common.base.MoreObjects.ToStringHelper
-
Field Details
-
extendedProperties
-
-
Constructor Details
-
BaseAttribute
protected BaseAttribute() -
BaseAttribute
-
-
Method Details
-
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
Called only from Jackson to implement deserialization via JsonAnySetter.- Parameters:
name
- property namevalue
- property value
-
toStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper() -
toString
-
listOrNull
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.
-