|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<Wallet>
org.starhope.appius.user.Wallet
public class Wallet
Field Summary | |
---|---|
private Map<String,BigDecimal> |
currency
amount of money in various forms |
private UserRecord |
myOwner
The owner of the wallet |
private static long |
serialVersionUID
WRITEME: Document this brpocock@star-hope.org |
Fields inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
myLoader, timeLastChanged, timeLastSaved |
Constructor Summary | |
---|---|
Wallet()
WRITEME: Document this constructor brpocock@star-hope.org |
|
Wallet(RecordLoader<Wallet> loader,
UserRecord owner)
constructor for being loaded for a certain user; |
|
Wallet(UserRecord owner)
default constructor for a new wallet for the given user |
Method Summary | |
---|---|
void |
add(String cu,
BigDecimal amount)
WRITEME: Document this method brpocock@star-hope.org |
Wallet |
copyProtoype(Wallet prototype)
WRITEME: Document this method brpocock@star-hope.org |
static Wallet |
forUser(UserRecord userRecord)
Get the wallet for a given user, creating a new one if necessary. |
BigDecimal |
get(Currency cu)
|
BigDecimal |
get(int n)
Check a random currency. |
Map<String,BigDecimal> |
getAllCurrency()
WRITEME: Document this method brpocock@star-hope.org |
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. |
private UserRecord |
getOwner()
WRITEME: Document this method brpocock@star-hope.org |
String |
getSubversionRevision()
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. |
void |
put(Currency cu,
BigDecimal amount)
WRITEME: Document this method brpocock@star-hope.org |
void |
put(String cu,
BigDecimal amount)
|
private void |
setOwner(UserRecord owner)
WRITEME: Document this method brpocock@star-hope.org |
org.json.JSONObject |
toJSON()
|
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 |
---|
private static final long serialVersionUID
private final Map<String,BigDecimal> currency
private UserRecord myOwner
Constructor Detail |
---|
public Wallet()
public Wallet(RecordLoader<Wallet> loader, UserRecord owner)
loader
- the record loaderowner
- the ownerpublic Wallet(UserRecord owner)
owner
- the owner of the walletMethod Detail |
---|
public static Wallet forUser(UserRecord userRecord)
userRecord
- the user whose wallet we want to see
public void add(String cu, BigDecimal amount)
cu
- WRITEMEamount
- WRITEMEpublic Wallet copyProtoype(Wallet prototype)
Copyable
copyProtoype
in interface Copyable<Wallet>
prototype
- WRITEME
Copyable.copyProtoype(org.starhope.appius.util.DataRecord)
public BigDecimal get(Currency cu)
cu
- currency units
public BigDecimal get(int n)
n
- WRITEME
public Map<String,BigDecimal> getAllCurrency()
public int getCacheableID() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableID
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
numeric IDDataRecord.getCacheableID()
public String getCacheableIdent() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableIdent
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
string identifierDataRecord.getCacheableIdent()
private UserRecord getOwner()
public String getSubversionRevision()
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: "; }
getSubversionRevision
in interface HasSubversionRevision
HasSubversionRevision.getSubversionRevision()
public void put(Currency cu, BigDecimal amount)
cu
- WRITEMEamount
- WRITEMEpublic void put(String cu, BigDecimal amount)
cu
- currency unitsamount
- amount of the given currency currently heldprivate void setOwner(UserRecord owner)
owner
- WRITEMEpublic org.json.JSONObject toJSON()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |