java.lang.Object | |
↳ | com.microstrategy.utils.DeltaProperties |
This class provides a means to detect property changes such that we can tell exactly which properties have changed from the original values.
This is achieved by using two Map
collections:
original
and modified
.
Various setters and getters simplify property resolution.
It also provides a visitor paradigm for traversing the properties,
identifying which have changed, and which have not.
Initial values are declared using the initialize
methods. Changes are made using the set
methods.
Class is not thread safe.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | DeltaProperties.Visitor | Implement this interface, and use either
visit(com.microstrategy.utils.DeltaProperties.Visitor, boolean) or
DeltaProperties#visitAll(com.microstrategy.utils.DeltaProperties.Visitor) to
traverse the contents of a DeltaProperties object. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | TAG_DELTA_PROPERTIES |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DeltaProperties() | |||||||||||
DeltaProperties(String name) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | buildXMLState(XMLBuilder builder) | ||||||||||
void | clear() | ||||||||||
Object | clone() | ||||||||||
AbstractHandler | createStateHandler() | ||||||||||
String | get(String key) | ||||||||||
boolean | getBoolean(String key) | ||||||||||
int | getInt(String key, int dvalue) | ||||||||||
int | getInt(String key) | ||||||||||
Set<String> | getModifiedKeys() | ||||||||||
String | getName() | ||||||||||
void | initialize(String key, boolean isTrue) | ||||||||||
void |
initialize(String key, String value)
Configures the baseline value.
| ||||||||||
void | initialize(String key, int value) | ||||||||||
boolean | isModified() | ||||||||||
boolean | isModified(String key) | ||||||||||
void |
persistModifications()
Replaces all original values with new modified values.
| ||||||||||
void |
set(String key, String value)
Properties are key-value pairs.
| ||||||||||
void |
set(String key, boolean isTrue)
Boolean values are internally stored as "1" for true,
and "0" for false.
| ||||||||||
void | set(String key, int value) | ||||||||||
void | visit(DeltaProperties.Visitor v, boolean onlyChangedProperties) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Configures the baseline value.
key | name of property |
---|---|
value | value of property |
Replaces all original values with new modified values. As a result, isModified()
will return
false.
Properties are key-value pairs. Note that the zero length string
"" will get converted into null upon save/restore state,
so "" and null should be treated as synonymous, i.e. as
defined by isEmpty(String)
.
key | unique name of property |
---|---|
value | property value |
Boolean values are internally stored as "1" for true, and "0" for false.