|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MetaAttributable
Identifies classes that can store simple key-value pairs for instances.
Please note: These meta-attributes are not inherited by subclasses in the schema!
All modifying methods may fire an EntityInUseException
if a
reserved key is used. Thus, a graph model that uses meta attributes
internally can prevent these from being overwritten. Such usage (and the
reserved keys) should be documented.
Since the getAllMetaAttributes()
also returns mappings for
reserved meta-attributes, it is recommended that the values used for
those are immutable to prevent external manipulation.
The Objects used as values must be serializable, meaning they not
only implement the Serializable
interface, but also make sure
their members are also serializable.
Meta-Attributes allow null
values.
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.io.Serializable> |
getAllMetaAttributes()
Returns a map containing all currently set meta-attribute key-value pairs. |
java.io.Serializable |
getMetaAttribute(java.lang.String key)
Returns the current value of a meta-attribute. |
boolean |
isMetaAttributeKeyReserved(java.lang.String key)
Checks whether a meta-attribute key is reserved for internal use. |
boolean |
isMetaAttributeSet(java.lang.String key)
Checks whether a meta-attribute is set. |
void |
setMetaAttribute(java.lang.String key,
java.io.Serializable value)
Sets a meta-attribute. |
void |
unsetMetaAttribute(java.lang.String key)
Removes a meta-attribute. |
Method Detail |
---|
void setMetaAttribute(java.lang.String key, java.io.Serializable value) throws EntityInUseException, DragosException
key
- The key that identifies the meta attribute.value
- The (new) value of this meta-attribute.
java.lang.IllegalArgumentException
- if key
is null
.
EntityInUseException
- if a key name is reserved for internal use.
DragosException
- if this object is no longer in its GraphPool/Schema, or something else went wrong.void unsetMetaAttribute(java.lang.String key) throws EntityInUseException, DragosException
key
- The key that identifies the meta attribute.
java.lang.IllegalArgumentException
- if key
is null
.
EntityInUseException
- if a key name is reserved for internal use.
DragosException
- if this object is no longer in its GraphPool/Schema, or something else went wrong.java.io.Serializable getMetaAttribute(java.lang.String key) throws EntityNotFoundException, DragosException
key
- The key that identifies the meta attribute.
java.lang.IllegalArgumentException
- if key
is null
.
EntityNotFoundException
- if no meta-attribute with that name exists.
DragosException
- if this object is no longer in its GraphPool/Schema, or something else went wrong.boolean isMetaAttributeSet(java.lang.String key) throws DragosException
key
- The key that identifies the meta attribute.
true
if the meta-attribute is set, false
otherwise.
java.lang.IllegalArgumentException
- if key
is null
.
DragosException
- if this object is no longer in its GraphPool/Schema, or something else went wrong.java.util.Map<java.lang.String,java.io.Serializable> getAllMetaAttributes() throws DragosException
Map
containing key-value pairs for all set meta-attributes.
DragosException
- if this object is no longer in its GraphPool/Schema, or something else went wrong.boolean isMetaAttributeKeyReserved(java.lang.String key) throws DragosException
key
- The key in question.
true
if this meta-attribute key is reserved, false
otherwise.
java.lang.IllegalArgumentException
- if key
is null
.
DragosException
- if this object is no longer in its GraphPool/Schema, or something else went wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |