org.starhope.appius.user
Class StringRecord

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

public class StringRecord
extends SimpleDataRecord<StringRecord>

A string, tied to identifiers, with minimal translation support

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

Field Summary
private  int myID
          unique ID
private  String myIdent
          unique ID
private static long serialVersionUID
          WRITEME: Document this brpocock@star-hope.org
private  Map<String,String> values
          The collection of versions of this string in various languages
 
Fields inherited from class org.starhope.appius.util.SimpleDataRecord
myLoader, timeLastChanged, timeLastSaved
 
Constructor Summary
StringRecord(RecordLoader<StringRecord> loader)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 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 getIdent()
           
 String getLocalised(String language_dialect)
           
 String getSubversionRevision()
           Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
 void setID(int id)
           
 void setIdent(String newIdent)
           
 void setValue(String language, String value)
           
 String toString()
           
 
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
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
WRITEME: Document this brpocock@star-hope.org

See Also:
Constant Field Values

myID

private int myID
unique ID


myIdent

private String myIdent
unique ID


values

private final Map<String,String> values
The collection of versions of this string in various languages

Constructor Detail

StringRecord

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

Parameters:
loader - WRITEME
Method Detail

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 myID

getIdent

public String getIdent()
Returns:
the myIdent

getLocalised

public String getLocalised(String language_dialect)
Parameters:
language_dialect - language and dialect code
Returns:
the string in that language and dialect, if possible; else, fall back upon English

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 id)
Parameters:
id - the myID to set

setIdent

public void setIdent(String newIdent)
Parameters:
newIdent - the myIdent to set

setValue

public void setValue(String language,
                     String value)
Parameters:
language - language
value - value

toString

public String toString()
Overrides:
toString in class SimpleDataRecord<StringRecord>
See Also:
Object.toString()