org.apache.tamaya.events

## Class ConfigurationContextChange

- java.lang.Object
- - org.apache.tamaya.events.ConfigurationContextChange

- All Implemented Interfaces:
    Serializable, ConfigEvent<org.apache.tamaya.spi.ConfigurationContext>

      public final class ConfigurationContextChange
      extends Object
      implements ConfigEvent<org.apache.tamaya.spi.ConfigurationContext>, Serializable

  Event that contains a set of current changes that were applied or can be applied. This class is immutable and thread-safe. To create instances use `PropertySourceChangeBuilder`. Created by Anatole on 22.10.2014.
  See Also:
    Serialized Form

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ConfigurationContextChange` | `emptyChangeSet(org.apache.tamaya.spi.ConfigurationContext configurationContext)` Get an empty change set for the given provider.
    `Collection<org.apache.tamaya.spi.PropertySource>` | `getAddedPropertySources()` Get the property sources to be added.
    `Collection<PropertySourceChange>` | `getPropertySourceChanges()` Get the changes recorded.
    `Collection<PropertySourceChange>` | `getPropertySourceUpdates()` Get the property source updates.
    `Collection<org.apache.tamaya.spi.PropertySource>` | `getRemovedPropertySources()` Get the property sources to be removed.
    `org.apache.tamaya.spi.ConfigurationContext` | `getResource()` Get the underlying property provider/configuration.
    `Class<org.apache.tamaya.spi.ConfigurationContext>` | `getResourceType()` Access the type of resource.
    `long` | `getTimestamp()` Get the timestamp in millis from the current epoch. it is expected that the timestamp and the version are unique to identify a changeset.
    `Collection<org.apache.tamaya.spi.PropertySource>` | `getUpdatedPropertySources()` Get the property sources to be updated.
    `String` | `getVersion()` Get the base version, usable for optimistic locking.
    `boolean` | `isAffected(org.apache.tamaya.spi.PropertySource propertySource)` Checks if the given propertySource is affected (added, changed or removed).
    `boolean` | `isEmpty()` CHecks if the current change set does not contain any changes.
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### emptyChangeSet

          public static ConfigurationContextChange emptyChangeSet(org.apache.tamaya.spi.ConfigurationContext configurationContext)

      Get an empty change set for the given provider.
      Parameters:
        `configurationContext` - context to use for creating changesets.
      Returns:
        an empty ConfigurationContextChange instance.

    - #### getResourceType

          public Class<org.apache.tamaya.spi.ConfigurationContext> getResourceType()

      Description copied from interface: `ConfigEvent`
      Access the type of resource. This allows to easily determine the resource an event wants to observe.
      Specified by:
        `getResourceType` in interface `ConfigEvent<org.apache.tamaya.spi.ConfigurationContext>`
      Returns:
        the resource type.

    - #### getResource

          public org.apache.tamaya.spi.ConfigurationContext getResource()

      Description copied from interface: `ConfigEvent`
      Get the underlying property provider/configuration.
      Specified by:
        `getResource` in interface `ConfigEvent<org.apache.tamaya.spi.ConfigurationContext>`
      Returns:
        the underlying property provider/configuration, never null.

    - #### getVersion

          public String getVersion()

      Get the base version, usable for optimistic locking.
      Specified by:
        `getVersion` in interface `ConfigEvent<org.apache.tamaya.spi.ConfigurationContext>`
      Returns:
        the base version.

    - #### getTimestamp

          public long getTimestamp()

      Get the timestamp in millis from the current epoch. it is expected that the timestamp and the version are unique to identify a changeset.
      Specified by:
        `getTimestamp` in interface `ConfigEvent<org.apache.tamaya.spi.ConfigurationContext>`
      Returns:
        the timestamp, when this changeset was created.

    - #### getPropertySourceChanges

          public Collection<PropertySourceChange> getPropertySourceChanges()

      Get the changes recorded.
      Returns:
        the recorded changes, never null.

    - #### getPropertySourceUpdates

          public Collection<PropertySourceChange> getPropertySourceUpdates()

      Get the property source updates.
      Returns:
        the recorded changes, never null.

    - #### getRemovedPropertySources

          public Collection<org.apache.tamaya.spi.PropertySource> getRemovedPropertySources()

      Get the property sources to be removed.
      Returns:
        the recorded changes, never null.

    - #### getAddedPropertySources

          public Collection<org.apache.tamaya.spi.PropertySource> getAddedPropertySources()

      Get the property sources to be added.
      Returns:
        the recorded changes, never null.

    - #### getUpdatedPropertySources

          public Collection<org.apache.tamaya.spi.PropertySource> getUpdatedPropertySources()

      Get the property sources to be updated.
      Returns:
        the recorded changes, never null.

    - #### isAffected

          public boolean isAffected(org.apache.tamaya.spi.PropertySource propertySource)

      Checks if the given propertySource is affected (added, changed or removed).
      Parameters:
        `propertySource` - the propertySource, not null.
      Returns:
        true, if the given propertySource ia affected.

    - #### isEmpty

          public boolean isEmpty()

      CHecks if the current change set does not contain any changes.
      Returns:
        tru, if the change set is empty.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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