|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<Currency>
org.starhope.appius.mb.Currency
public class Currency
| Field Summary | |
|---|---|
private String |
code
The ISO-4217 currency code (three letters); "USD" is U.S. |
private static long |
serialVersionUID
|
private String |
symbol
The display character sequence. |
private String |
title
Title |
| Fields inherited from class org.starhope.appius.util.SimpleDataRecord |
|---|
myLoader, timeLastChanged, timeLastSaved |
| Constructor Summary | |
|---|---|
Currency()
WRITEME: Document this constructor brpocock@star-hope.org |
|
Currency(RecordLoader<Currency> loader)
WRITEME: Document this constructor brpocock@star-hope.org |
|
| Method Summary | |
|---|---|
static Currency |
get_USD()
This is a quick "semantic sugar" to pick up U.S. |
static Currency |
get(String id)
Deprecated. Use Nomenclator.getDataRecord(Class, String)
instead |
static Currency |
getByCode(String string)
Deprecated. use Nomenclator.getDataRecord(Class, String) |
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. |
String |
getCode()
Get the three-character (ISO-4217) currency code. |
static Currency |
getPeanuts()
TODO: refer to database, to be paranoid. |
String |
getSubversionRevision()
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. |
String |
getSymbol()
|
String |
getTitle()
|
static Currency |
getTootTokens()
TODO: refer to database, to be paranoid. |
void |
setCode(String newCode)
Change the currency code for this instance. |
void |
setSymbol(String newSymbol)
Set the user-visible displayed symbol of this currency. |
void |
setTitle(String newTitle)
|
org.json.JSONObject |
toJSON()
WRITEME: Document this method brpocock@star-hope.org |
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 |
|---|
private static final long serialVersionUID
private String code
private String symbol
private String title
| Constructor Detail |
|---|
public Currency()
public Currency(RecordLoader<Currency> loader)
loader - WRITEME| Method Detail |
|---|
@Deprecated
public static Currency get(String id)
throws RuntimeException,
NotFoundException
Nomenclator.getDataRecord(Class, String)
instead
id - ISO-4217 currency code
NotFoundException - if it's not found in the database
RuntimeException - if something else wonky were to happenpublic static final Currency get_USD()
This is a quick "semantic sugar" to pick up U.S. Dollars as a currency format, since that's realistically the only one we're dealing with at the moment.
TODO: refer to database, to be paranoid.
@Deprecated
public static Currency getByCode(String string)
throws NotFoundException
Nomenclator.getDataRecord(Class, String)
string - ISO-4217 currency code
NotFoundException - if it can't be foundpublic static final Currency getPeanuts()
public static final Currency getTootTokens()
public int getCacheableID()
throws NotFoundException
DataRecordDataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both.
getCacheableID in interface DataRecordNotFoundException - if the item doesn't have a distinct
numeric IDDataRecord.getCacheableID()
public String getCacheableIdent()
throws NotFoundException
DataRecordDataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both.
getCacheableIdent in interface DataRecordNotFoundException - if the item doesn't have a distinct
string identifierDataRecord.getCacheableIdent()public String getCode()
public String getSubversionRevision()
HasSubversionRevisionReturn 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: ";
}
getSubversionRevision in interface HasSubversionRevisionHasSubversionRevision.getSubversionRevision()public String getSymbol()
Returns the currency symbol for user presentation
of prices.public String getTitle()
public void setCode(String newCode)
throws DataException
newCode - The new currency code to be set (ISO-4217,
uppercase, e.g. "USD")
DataException - if the specification does not consist of
three AppiusCharacter.UPPERCASE_LETTER characters.
public void setSymbol(String newSymbol)
throws DataException
newSymbol - The new symbol string to be used for this
currency
DataException - if the new symbol string is not supplied,
or is more than 5 characters longpublic void setTitle(String newTitle)
newTitle - the title to setpublic org.json.JSONObject toJSON()
toJSON in interface CastsToJSONpublic String toString()
toString in class SimpleDataRecord<Currency>Object.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||