org.starhope.appius.user
Class AvatarBodyFormat

java.lang.Object
  extended by org.starhope.appius.util.SimpleDataRecord<AvatarBodyFormat>
      extended by org.starhope.appius.user.AvatarBodyFormat
All Implemented Interfaces:
com.whirlycott.cache.Cacheable, Serializable, Comparable<AvatarBodyFormat>, CTime, DataRecord, HasSubversionRevision

public class AvatarBodyFormat
extends SimpleDataRecord<AvatarBodyFormat>

The Avatar Body Format is a description of the layout/structure of a body of which a particular AvatarClass may subscribe. For example, all avatars of a bipedal humanoid variety might share an avatar body format, even if they represent humans, elves, bipedal Toots, &c.

Author:
brpocock@star-hope.org
See Also:
Serialized Form

Field Summary
private  int id
          Numeric ID of the body format
private  String name
          Name of the body format
private static long serialVersionUID
          Java serialisation unique ID
 
Fields inherited from class org.starhope.appius.util.SimpleDataRecord
myLoader, timeLastChanged, timeLastSaved
 
Constructor Summary
AvatarBodyFormat()
          construct a new avatar body format
AvatarBodyFormat(RecordLoader<AvatarBodyFormat> loader)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 boolean canEquip(InventoryItemType type)
          Determine whether avatars using this body format are permitted to equip items of the given type.
 int getCacheableID()
          Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.
 String getCacheableIdent()
          Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.
 int getID()
           
 String getName()
           
 String getSubversionRevision()
           Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
 void setID(int newID)
           
 void setName(String newName)
           
 
Methods inherited from class org.starhope.appius.util.SimpleDataRecord
changed, checkStale, compareTo, equals, finalize, getRecordLoader, getTimeLastChanged, getTimeLastSaved, hashCode, isBeingLoaded, markAsLoaded, markAsSaved, markForReload, onRemove, onRetrieve, onStore, save, setRecordLoader, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Java serialisation unique ID

See Also:
Constant Field Values

id

private int id
Numeric ID of the body format


name

private String name
Name of the body format

Constructor Detail

AvatarBodyFormat

public AvatarBodyFormat()
construct a new avatar body format


AvatarBodyFormat

public AvatarBodyFormat(RecordLoader<AvatarBodyFormat> loader)
WRITEME: Document this constructor brpocock@star-hope.org

Parameters:
loader - loader
Method Detail

canEquip

public boolean canEquip(InventoryItemType type)
Determine whether avatars using this body format are permitted to equip items of the given type. This is a veto authority, not an assertion of privilege: there could still be another reason why a particular user might not be permitted to equip the item. This, however, might e.g. prevent a dog from wearing human shoes.

Parameters:
type - the InventoryItemType being interrogated-against
Returns:
true, if avatars having this body format might potentially equip an item of that type.

getCacheableID

public int getCacheableID()
                   throws NotFoundException
Description copied from interface: DataRecord
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.

Returns:
an unique ID number
Throws:
NotFoundException - if the item doesn't have a distinct numeric ID
See Also:
DataRecord.getCacheableID()

getCacheableIdent

public String getCacheableIdent()
                         throws NotFoundException
Description copied from interface: DataRecord
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier ( DataRecord.getCacheableIdent() or both.

Returns:
an unique identifier string
Throws:
NotFoundException - if the item doesn't have a distinct string identifier
See Also:
DataRecord.getCacheableIdent()

getID

public int getID()
Returns:
the id

getName

public String getName()
Returns:
the name

getSubversionRevision

public String getSubversionRevision()
Description copied from interface: HasSubversionRevision

Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.

As an example,the Subversion revision string for this file is "$Rev: 1968 $"

 
 @Override
 public String getSubversionRevision () {
        return "$Rev: ";
 }
 

Returns:
The Subversion revision level for this class's source code file.
See Also:
HasSubversionRevision.getSubversionRevision()

setID

public void setID(int newID)
Parameters:
newID - the id to set

setName

public void setName(String newName)
Parameters:
newName - the name to set