Class AbstractIdentifiable
java.lang.Object
net.okapia.osid.jamocha.spi.AbstractIdentifiable
- All Implemented Interfaces:
Identifiable
- Direct Known Subclasses:
AbstractAdapterIdentifiable, AbstractOsidForm, AbstractOsidNode, AbstractOsidObject
Defines a simple Id based object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcurrent()Sets the current flag totrue.final booleanDetermines if the givenIdis equal to this one.getId()Gets theIdassociated with this instance of this OSID object.inthashCode()Returns a hash code value for thisOsidObjectbased on theId.booleanTests to see if the last method invoked retrieved up-to-date data.protected voidSets theIdassociated with this instance of this OSID object.protected voidstale()Sets the current flag tofalse.toString()Returns a string representation of this OsidObject.
-
Constructor Details
-
AbstractIdentifiable
public AbstractIdentifiable()Constructs a newAbstractIdentifiable.
-
-
Method Details
-
getId
Gets theIdassociated with this instance of this OSID object.- Specified by:
getIdin interfaceIdentifiable- Returns:
- the
Id - Throws:
IllegalStateException- the Id has not been set
-
setId
Sets theIdassociated with this instance of this OSID object.- Parameters:
id- the Id to set- Throws:
NullArgumentException-isisnull
-
isCurrent
Tests to see if the last method invoked retrieved up-to-date data. Simple retrieval methods do not specify errors as, generally, the data is retrieved once at the time this object is instantiated. Some implementations may provide real-time data though the application may not always care. An implementation providing a real-time service may fall back to a previous snapshot in case of error. This method returns false if the data last retrieved was stale.- Specified by:
isCurrentin interfaceIdentifiable- Returns:
trueif the object is up to date,falseotherwise
-
current
protected void current()Sets the current flag totrue. -
stale
protected void stale()Sets the current flag tofalse. -
equals
Determines if the givenIdis equal to this one. Two Ids are equal if the namespace, authority and identifier components are equal. The identifier is case sensitive while the namespace and authority strings are not case sensitive. -
hashCode
-
toString
-