Package org.apache.unomi.api
Class Metadata
- java.lang.Object
-
- org.apache.unomi.api.Metadata
-
- All Implemented Interfaces:
Serializable,Comparable<Metadata>
public class Metadata extends Object implements Comparable<Metadata>, Serializable
A class providing information about context server entities.- See Also:
MetadataItem, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringSYSTEM_SCOPEDefault scope, gathers default entities and can also be used to share entities across scopes.
-
Constructor Summary
Constructors Constructor Description Metadata()Instantiates a new Metadata.Metadata(String id)Instantiates a new Metadata with the specified identifier.Metadata(String scope, String id, String name, String description)Instantiates a new Metadata with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Metadata o)booleanequals(Object o)StringgetDescription()Retrieves the description.StringgetId()Retrieves the identifier for the entity associated with this MetadataStringgetName()Retrieves the name.StringgetScope()Retrieves the scope for the entity associated with this MetadataSet<String>getSystemTags()Retrieves a set ofStringsystem tag names associated with this MetadataSet<String>getTags()Retrieves a set ofStringtag names associated with this MetadatainthashCode()booleanisEnabled()Whether the associated entity is considered active by the context server, in particular to check if rules need to be created / triggeredbooleanisHidden()Whether the associated entity is considered for internal purposes only and should therefore be hidden to accessing UIs.booleanisMissingPlugins()Whether the associated entity is waiting on additional plugins to become available to be able to properly perform its function.booleanisReadOnly()Whether the associated entity can be accessed but not modified.voidsetDescription(String description)Sets the description.voidsetEnabled(boolean enabled)Specifies whether the associated entity should be active or not.voidsetHidden(boolean hidden)Specifies whether the associated entity is hidden.voidsetId(String id)Sets the id.voidsetMissingPlugins(boolean missingPlugins)Specifies whether the associated entity is waiting on additional plugins to become available.voidsetName(String name)Sets the name.voidsetReadOnly(boolean readOnly)Specifies whether the associated entity should be only accessed and not modified.voidsetScope(String scope)Sets the scope.voidsetSystemTags(Set<String> systemTags)Sets the system tags.voidsetTags(Set<String> tags)Sets the tags.
-
-
-
Field Detail
-
SYSTEM_SCOPE
public static final String SYSTEM_SCOPE
Default scope, gathers default entities and can also be used to share entities across scopes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Metadata
public Metadata()
Instantiates a new Metadata.
-
Metadata
public Metadata(String id)
Instantiates a new Metadata with the specified identifier.- Parameters:
id- the identifier for this Metadata
-
-
Method Detail
-
getId
public String getId()
Retrieves the identifier for the entity associated with this Metadata- Returns:
- the identifier
-
setId
public void setId(String id)
Sets the id.- Parameters:
id- the id
-
getName
public String getName()
Retrieves the name.- Returns:
- the name
-
setName
public void setName(String name)
Sets the name.- Parameters:
name- the name
-
getDescription
public String getDescription()
Retrieves the description.- Returns:
- the description
-
setDescription
public void setDescription(String description)
Sets the description.- Parameters:
description- the description
-
getScope
public String getScope()
Retrieves the scope for the entity associated with this Metadata- Returns:
- the scope for the entity associated with this Metadata
- See Also:
Item for a deeper discussion of scopes
-
setScope
public void setScope(String scope)
Sets the scope.- Parameters:
scope- the scope
-
getTags
public Set<String> getTags()
Retrieves a set ofStringtag names associated with this Metadata- Returns:
- a set of
Stringtag names associated with this Metadata
-
getSystemTags
public Set<String> getSystemTags()
Retrieves a set ofStringsystem tag names associated with this Metadata- Returns:
- a set of
Stringsystem tag names associated with this Metadata
-
setSystemTags
public void setSystemTags(Set<String> systemTags)
Sets the system tags.- Parameters:
systemTags- the system tag ids
-
isEnabled
public boolean isEnabled()
Whether the associated entity is considered active by the context server, in particular to check if rules need to be created / triggered- Returns:
trueif the associated entity is enabled,falseotherwise
-
setEnabled
public void setEnabled(boolean enabled)
Specifies whether the associated entity should be active or not.- Parameters:
enabled-trueif the associated entity is enabled,falseotherwise
-
isMissingPlugins
public boolean isMissingPlugins()
Whether the associated entity is waiting on additional plugins to become available to be able to properly perform its function.- Returns:
trueif plugins are missing,falseotherwise
-
setMissingPlugins
public void setMissingPlugins(boolean missingPlugins)
Specifies whether the associated entity is waiting on additional plugins to become available.- Parameters:
missingPlugins-trueif plugins are missing,falseotherwise
-
isHidden
public boolean isHidden()
Whether the associated entity is considered for internal purposes only and should therefore be hidden to accessing UIs.- Returns:
trueif the associated entity needs to be hidden,falseotherwise
-
setHidden
public void setHidden(boolean hidden)
Specifies whether the associated entity is hidden.- Parameters:
hidden-trueif the associated entity needs to be hidden,falseotherwise
-
isReadOnly
public boolean isReadOnly()
Whether the associated entity can be accessed but not modified.- Returns:
trueif the associated entity can be accessed but not modified,falseotherwise
-
setReadOnly
public void setReadOnly(boolean readOnly)
Specifies whether the associated entity should be only accessed and not modified.- Parameters:
readOnly-trueif the associated entity can be accessed but not modified,falseotherwise
-
compareTo
public int compareTo(Metadata o)
- Specified by:
compareToin interfaceComparable<Metadata>
-
-