it.list.jft
Interface Entity

All Superinterfaces:
Cloneable, EntityClass, Serializable

public interface Entity
extends EntityClass, Cloneable, Serializable

Interface that describes a specific instance of a EntityClass.

All entities objects share two common methods to retrieve full and partial EntityKeys, in additions to inherithed methods from EntityClass.

All other specific fields of each entity are available as specific fields of the correspinding Java object that implements this interface.


Field Summary
 
Fields inherited from interface EntityClass
TYPE_ENTITY, TYPE_ENUM
 
Method Summary
 Object clone()
          Implement Cloneable interface.
 Object getField(String fieldName)
          Returns a field value of this Entity.
 EntityKey getFullEntityKey(int keyID)
          Returns a given full EntityKey of this Entity.
 EntityKey getPartialEntityKey(int keyID, int numSegments)
          Returns a given partial EntityKey of this Entity.
 void setField(String fieldName, Object value)
          Set a field value of this Entity.
 
Methods inherited from interface EntityClass
getEntityClassID, getEntityClassName, getEntityFields, getNumSegments, getType, isKey, isKey, makeEntity
 

Method Detail

getFullEntityKey

EntityKey getFullEntityKey(int keyID)
Returns a given full EntityKey of this Entity.

Please note:
   getFullEntityKey(keyID) == getPartialEntityKey(keyID, getNumSegments(keyID))

Parameters:
keyID - the index of a key of this class.
Returns:
a given full EntityKey of this Entity.
null is returned when the given keyID does not refer to a valid key for the EntityClass of this Entity.

getPartialEntityKey

EntityKey getPartialEntityKey(int keyID,
                              int numSegments)
Returns a given partial EntityKey of this Entity.

Parameters:
keyID - the index of a key of this class.
numSegments - number of initial segments that must be present in the partial key.
Returns:
a given partial EntityKey of this Entity.
null is returned when the given keyID does not refer to a valid key for the EntityClass of this Entity,
or when the given numSegments parameter is <=0 or > getNumSegments(keyID).

getField

Object getField(String fieldName)
                throws NullPointerException,
                       IllegalArgumentException
Returns a field value of this Entity.

Please note:
- to get array value at index i use "fieldname[i]"
- for nested entity field use "." as separator

For primitive value, it returns the Object corresponding to it (e.g. int as returned as Integer).

Parameters:
fieldName - the name of the field.
Returns:
the Object value of the field.
null is returned when the given fieldName does not refer to a valid field for the EntityClass of this Entity.
Throws:
IllegalArgumentException - if the field name is not valid.
NullPointerException

setField

void setField(String fieldName,
              Object value)
              throws NullPointerException,
                     IllegalArgumentException,
                     ClassCastException
Set a field value of this Entity.

Parameters:
fieldName - the name of the field.
value - the Object value of the field.
Throws:
IllegalArgumentException - if the field name is not valid.
ClassCastException - if the Object value type is not valid.
NullPointerException
See Also:
getField(java.lang.String)

clone

Object clone()
             throws CloneNotSupportedException
Implement Cloneable interface.

Throws:
CloneNotSupportedException


Submit a bug or feature to FT\API Programming Support<\font>