org.apache.tamaya.mutableconfig.propertysources

## Class ConfigChangeContext

- java.lang.Object
- - org.apache.tamaya.mutableconfig.propertysources.ConfigChangeContext

-     public final class ConfigChangeContext
      extends Object

  Transactional context used for managing configuration changes within an `AbstractMutablePropertySource`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigChangeContext(UUID transactionID)` Creates a new instance bound to the given transaction.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `Map<String,String>` | `getAddedProperties()` Get an unmodifiable key/value map of properties added or updated.
    `Set<String>` | `getRemovedProperties()` Get an unmodifiable key set of properties removed.
    `long` | `getStartedAt()` Timestamp in UTC millis, when this transaction (context) was created.
    `UUID` | `getTransactionID()` Get the corresppnding transaction ID of this instance.
    `int` | `hashCode()`
    `boolean` | `isEmpty()` Allows easily to check if no additions/changes an no removals are present in the current transaction.
    `void` | `put(String key, String value)` Adds/updates a new key/value pair.
    `void` | `putAll(Map<String,String> properties)` Add/updated multiple key/values.
    `void` | `removeAll(Collection<String> keys)` Remove all the given keys, ir present.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ConfigChangeContext

          public ConfigChangeContext(UUID transactionID)

      Creates a new instance bound to the given transaction.
      Parameters:
        `transactionID` - the transaction ID, not null.

  - ### Method Detail

    - #### getTransactionID

          public UUID getTransactionID()

      Get the corresppnding transaction ID of this instance.
      Returns:
        the transaction ID, never null.

    - #### getStartedAt

          public long getStartedAt()

      Timestamp in UTC millis, when this transaction (context) was created.
      Returns:
        the timestamp in millis.

    - #### getAddedProperties

          public Map<String,String> getAddedProperties()

      Get an unmodifiable key/value map of properties added or updated.
      Returns:
        an unmodifiable key/value map of properties added or updated, never null.

    - #### getRemovedProperties

          public Set<String> getRemovedProperties()

      Get an unmodifiable key set of properties removed.
      Returns:
        an unmodifiable key set of properties removed, never null.

    - #### put

          public void put(String key,
                 String value)

      Adds/updates a new key/value pair.
      Parameters:
        `key` - the key, not null.
        `value` - the value, not null.

    - #### putAll

          public void putAll(Map<String,String> properties)

      Add/updated multiple key/values.
      Parameters:
        `properties` - the keys and values to be added/updated, not null.

    - #### removeAll

          public void removeAll(Collection<String> keys)

      Remove all the given keys, ir present.
      Parameters:
        `keys` - the keys to be removed, not null.

    - #### isEmpty

          public boolean isEmpty()

      Allows easily to check if no additions/changes an no removals are present in the current transaction.
      Returns:
        true, if not actions have to be committed.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.