public class

DeltaProperties

extends Object
implements Cloneable
java.lang.Object
   ↳ com.microstrategy.utils.DeltaProperties

Class Overview

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.

Summary

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
From class java.lang.Object

Constants

public static final String TAG_DELTA_PROPERTIES

Constant Value: "dprs"

Public Constructors

public DeltaProperties ()

public DeltaProperties (String name)

Public Methods

public void buildXMLState (XMLBuilder builder)

public void clear ()

public Object clone ()

public AbstractHandler createStateHandler ()

public String get (String key)

public boolean getBoolean (String key)

public int getInt (String key, int dvalue)

public int getInt (String key)

public Set<String> getModifiedKeys ()

Returns
  • the set of keys that have been flagged as modified.

public String getName ()

public void initialize (String key, boolean isTrue)

public void initialize (String key, String value)

Configures the baseline value.

Parameters
key name of property
value value of property

public void initialize (String key, int value)

public boolean isModified ()

public boolean isModified (String key)

public void persistModifications ()

Replaces all original values with new modified values. As a result, isModified() will return false.

public void set (String key, String value)

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).

Parameters
key unique name of property
value property value

public void set (String key, boolean isTrue)

Boolean values are internally stored as "1" for true, and "0" for false.

public void set (String key, int value)

public void visit (DeltaProperties.Visitor v, boolean onlyChangedProperties)