org.apache.tamaya.events

## Class ConfigurationContextChangeBuilder

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

-     public final class ConfigurationContextChangeBuilder
      extends Object

  Models a set of current changes applied to a `PropertySource`. Consumers of these events can observe changes to property sources and
  1. check if their current configuration instance (`ConfigurationContext` contains the changed `PropertySource` (Note: the reference to a property source is never affected by a change, it is the data of the property source only).
  2. if so, a corresponding action may be taken, such as reevaluating the configuration values (depending on the update policy) or reevaluating the complete `Configuration` to create a change event on configuration level.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConfigurationContextChange` | `build()` Builds the corresponding change set.
    `ConfigurationContextChangeBuilder` | `changedPropertySource(PropertySourceChange propertySourceChange)` This method records all changes to be applied to the base property provider/configuration to achieve the given target state.
    `boolean` | `isEmpty()` Checks if the change set is empty, i.e. does not contain any changes.
    `ConfigurationContextChangeBuilder` | `newPropertySource(org.apache.tamaya.spi.PropertySource propertySource)` This method records all changes to be applied to the base property provider/configuration to achieve the given target state.
    `static ConfigurationContextChangeBuilder` | `of()` Just creates a new ConfigurationContextBuilder using the current COnfigurationContext has root resource.
    `static ConfigurationContextChangeBuilder` | `of(org.apache.tamaya.spi.ConfigurationContext context)` Creates a new instance current this builder.
    `ConfigurationContextChangeBuilder` | `removedPropertySource(org.apache.tamaya.spi.PropertySource propertySource)` This method records all changes to be applied to the base property provider/configuration to achieve the given target state.
    `void` | `reset()` Resets this change set instance.
    `ConfigurationContextChangeBuilder` | `setTimestamp(long timestamp)` Apply given timestamp to the set being built.
    `ConfigurationContextChangeBuilder` | `setVersion(String version)` Apply a version/UUID to the set being built.
    `String` | `toString()`

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

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

- - ### Method Detail

    - #### of

          public static ConfigurationContextChangeBuilder of()

      Just creates a new ConfigurationContextBuilder using the current COnfigurationContext has root resource.
      Returns:
        a new ConfigurationContextBuilder, never null.

    - #### of

          public static ConfigurationContextChangeBuilder of(org.apache.tamaya.spi.ConfigurationContext context)

      Creates a new instance current this builder.
      Parameters:
        `context` - context to use for creating changesets.
      Returns:
        the builder for chaining.

    - #### setVersion

          public ConfigurationContextChangeBuilder setVersion(String version)

      Apply a version/UUID to the set being built.
      Parameters:
        `version` - the version to apply, or null, to let the system generate a version for you.
      Returns:
        the builder for chaining.

    - #### setTimestamp

          public ConfigurationContextChangeBuilder setTimestamp(long timestamp)

      Apply given timestamp to the set being built.
      Parameters:
        `timestamp` - timestamp to set.
      Returns:
        the builder for chaining.

    - #### newPropertySource

          public ConfigurationContextChangeBuilder newPropertySource(org.apache.tamaya.spi.PropertySource propertySource)

      This method records all changes to be applied to the base property provider/configuration to achieve the given target state.
      Parameters:
        `propertySource` - the new target state, not null.
      Returns:
        the builder for chaining.

    - #### removedPropertySource

          public ConfigurationContextChangeBuilder removedPropertySource(org.apache.tamaya.spi.PropertySource propertySource)

      This method records all changes to be applied to the base property provider/configuration to achieve the given target state.
      Parameters:
        `propertySource` - the new target state, not null.
      Returns:
        the builder for chaining.

    - #### changedPropertySource

          public ConfigurationContextChangeBuilder changedPropertySource(PropertySourceChange propertySourceChange)

      This method records all changes to be applied to the base property provider/configuration to achieve the given target state.
      Parameters:
        `propertySourceChange` - the change state, not null.
      Returns:
        the builder for chaining.

    - #### isEmpty

          public boolean isEmpty()

      Checks if the change set is empty, i.e. does not contain any changes.
      Returns:
        true, if the set is empty.

    - #### reset

          public void reset()

      Resets this change set instance. This will clear all changes done to this builder, so the set will be empty.

    - #### build

          public ConfigurationContextChange build()

      Builds the corresponding change set.
      Returns:
        the new change set, never null.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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