Class DeltaProperties

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class DeltaProperties
    extends java.lang.Object
    implements java.lang.Cloneable

    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.

    Since:
    MicroStrategy Web 9.0.0
    • Field Detail

      • TAG_DELTA_PROPERTIES

        public static final java.lang.String TAG_DELTA_PROPERTIES
        See Also:
        Constant Field Values
    • Constructor Detail

      • DeltaProperties

        public DeltaProperties()
      • DeltaProperties

        public DeltaProperties​(java.lang.String name)
    • Method Detail

      • getName

        public java.lang.String getName()
      • initialize

        public void initialize​(java.lang.String key,
                               java.lang.String value)
        Configures the baseline value.
        Parameters:
        key - name of property
        value - value of property
      • initialize

        public void initialize​(java.lang.String key,
                               boolean isTrue)
      • initialize

        public void initialize​(java.lang.String key,
                               int value)
      • clear

        public void clear()
      • set

        public void set​(java.lang.String key,
                        java.lang.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 StringUtils.isEmpty(String).
        Parameters:
        key - unique name of property
        value - property value
      • get

        public java.lang.String get​(java.lang.String key)
      • getInt

        public int getInt​(java.lang.String key)
      • getInt

        public int getInt​(java.lang.String key,
                          int dvalue)
        Since:
        MicroStrategy Web 9.0.1
      • set

        public void set​(java.lang.String key,
                        int value)
      • getBoolean

        public boolean getBoolean​(java.lang.String key)
      • set

        public void set​(java.lang.String key,
                        boolean isTrue)
        Boolean values are internally stored as "1" for true, and "0" for false.
      • isModified

        public boolean isModified​(java.lang.String key)
      • isModified

        public boolean isModified()
      • buildXMLState

        public void buildXMLState​(XMLBuilder builder)
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • persistModifications

        public void persistModifications()
        Replaces all original values with new modified values. As a result, isModified() will return false.
      • getModifiedKeys

        public java.util.Set<java.lang.String> getModifiedKeys()
        Returns:
        the set of keys that have been flagged as modified.