Package tv.phantombot
Class CaselessProperties.Transaction
java.lang.Object
tv.phantombot.CaselessProperties.Transaction
- Enclosing class:
- CaselessProperties
Represents a transaction which apples new values to the property set simultaneously
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intHigh prioritystatic final intLow prioritystatic final intMaximum prioritystatic final intMinimum prioritystatic final intNormal priority
- 
Method SummaryModifier and TypeMethodDescriptionvoidcommit()Commits all new/updated properties in this transaction to theCaselessPropertiesinstance, then saves the stateAnInstantindicating when this transaction was committedintReturns the priority of this transactionbooleanReturns if this transaction has been committedvoidMarks a property to be removedvoidsetProperty(String key, boolean value) Sets a boolean value in the transactionvoidsetProperty(String key, double value) Sets a double value in the transactionvoidsetProperty(String key, int value) Sets an integer value in the transactionvoidsetProperty(String key, long value) Sets a long value in the transactionvoidsetProperty(String key, String value) Sets a string value in the transaction
- 
Field Details- 
PRIORITY_NONEpublic static final int PRIORITY_NONEMinimum priority- See Also:
 
- 
PRIORITY_LOWpublic static final int PRIORITY_LOWLow priority- See Also:
 
- 
PRIORITY_NORMALpublic static final int PRIORITY_NORMALNormal priority- See Also:
 
- 
PRIORITY_HIGHpublic static final int PRIORITY_HIGHHigh priority- See Also:
 
- 
PRIORITY_MAXpublic static final int PRIORITY_MAXMaximum priority- See Also:
 
 
- 
- 
Method Details- 
getPrioritypublic int getPriority()Returns the priority of this transaction- Returns:
- the priority
 
- 
removeMarks a property to be removed- Parameters:
- key- the proeprty key
- Throws:
- IllegalStateException- if this transaction is already committed
 
- 
setPropertySets a string value in the transactionSetting valuetonullwill mark the property for removal- Parameters:
- key- the property key
- value- the new value
- Throws:
- IllegalStateException- if this transaction is already committed
 
- 
setPropertySets an integer value in the transaction- Parameters:
- key- the property key
- value- the new value
- Throws:
- IllegalStateException- if this transaction is already committed
 
- 
setPropertySets a long value in the transaction- Parameters:
- key- the property key
- value- the new value
- Throws:
- IllegalStateException- if this transaction is already committed
 
- 
setPropertySets a double value in the transaction- Parameters:
- key- the property key
- value- the new value
- Throws:
- IllegalStateException- if this transaction is already committed
 
- 
setPropertySets a boolean value in the transaction- Parameters:
- key- the property key
- value- the new value
- Throws:
- IllegalStateException- if this transaction is already committed
 
- 
isCommittedpublic boolean isCommitted()Returns if this transaction has been committed- Returns:
- trueif this transaction has been committed
 
- 
getCommitTimeAnInstantindicating when this transaction was committed- Returns:
- the Instantwhen this transaction was committed;nullif this transaction is not yet committed
 
- 
commitpublic void commit()Commits all new/updated properties in this transaction to theCaselessPropertiesinstance, then saves the state
 
-