|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.gm.core.schema.AbstractAttribute
public abstract class AbstractAttribute
An AbstractAttribute
uniquely identifies an attribute.
Constructor Summary | |
---|---|
protected |
AbstractAttribute(DataSourceURL dataSourceURL,
GraphEntityClass gec,
java.io.Serializable identifier,
java.lang.String name,
java.lang.Class type)
Constructs a new attribute. |
Method Summary | |
---|---|
abstract void |
checkExistence()
Checks whether this object still exists, throwing an exception if not. |
void |
checkExistenceOptional()
Checks whether this object still exists, throwing an exception if not. |
boolean |
equals(java.lang.Object o)
Checks for equality with another object. |
DataSourceURL |
getDataSourceURL()
Returns the DataSourceURL of the schema this attribute belongs to. |
GraphEntityClass |
getGraphEntityClass()
Returns the schema entity the attribute belongs to. |
java.io.Serializable |
getInternalIdentifier()
Returns the internal internal identifier of the attribute. |
java.lang.String |
getName()
Returns the attribute's name. |
java.lang.Class |
getType()
Returns the attribute's value type. |
abstract int |
hashCode()
To comply with the general contract for Object.hashCode() ,
it is recommended to return the hash code of the internal identifier. |
boolean |
isMetaAttributeKeyReserved(java.lang.String key)
This default implementation always returns false . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface i3.dragos.gm.core.schema.Attribute |
---|
getWrappedAttribute |
Methods inherited from interface i3.dragos.gm.core.schema.MetaAttributable |
---|
getAllMetaAttributes, getMetaAttribute, isMetaAttributeSet, setMetaAttribute, unsetMetaAttribute |
Constructor Detail |
---|
protected AbstractAttribute(DataSourceURL dataSourceURL, GraphEntityClass gec, java.io.Serializable identifier, java.lang.String name, java.lang.Class type) throws java.lang.IllegalArgumentException
dataSourceURL
- The DataSourceURL of the schema this AbstractAttribute belongs to.gec
- The schema entity this attribute belongs to.identifier
- The identifiername
- The attribute's name.type
- The type of the attribute's value.
java.lang.IllegalArgumentException
- if gec, id, type is null
or if name is null or is equal to an empty string.Method Detail |
---|
public final GraphEntityClass getGraphEntityClass()
getGraphEntityClass
in interface Attribute
public final java.io.Serializable getInternalIdentifier()
getInternalIdentifier
in interface Attribute
public final java.lang.String getName()
getName
in interface Attribute
public final java.lang.Class getType()
getType
in interface Attribute
public final DataSourceURL getDataSourceURL()
null
.
getDataSourceURL
in interface Attribute
public abstract int hashCode()
Object.hashCode()
,
it is recommended to return the hash code of the internal identifier.
hashCode
in interface Attribute
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
This object is considered equal if all of the following conditions are met:
o != null
o instanceof AbstractAttribute
getDataSourceURL().equals(((GraphEntity) o).getDataSourceURL())
getInternalIdentifier().equals(((GraphEntity) o).getInternalIdentifier())
Subclasses and implementations might want to extend it by adding
assertions comparing additional or internal data. However, equality must
only be determined by above rules, preferably by using
super.equals(o)
, and any differences in the additional
data for two equal attributes is to be considered an error.
equals
in interface Attribute
equals
in class java.lang.Object
o
- The Object to compare to.
true
if o
is equal according to
above rules, false
otherwise.public boolean isMetaAttributeKeyReserved(java.lang.String key) throws DragosException
false
.
isMetaAttributeKeyReserved
in interface MetaAttributable
key
- The key in question.
false
.
DragosException
- if something goes wrong.MetaAttributable
public abstract void checkExistence() throws java.lang.RuntimeException
checkExistence
in interface ExistenceCheckable
java.lang.RuntimeException
- if this object no longer exists or an error occurred while accessing the GraphPool.public void checkExistenceOptional() throws java.lang.RuntimeException
A useful default implementation would be as follows:
try { GraphPool gp = GraphPoolFactory.get(getDataSourceURL()); if (gp.getForceExistenceCheckOnRead()) { checkExistence(); } } catch (DragosException e) { String message = "Caught GraphPoolException while trying to determine whether to perform checks on read operation!"; log.error(message); throw new RuntimeException(message); }
checkExistenceOptional
in interface ExistenceCheckable
java.lang.RuntimeException
- if this object no longer exists or an error occurred while accessing the GraphPool.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |