org.apache.tamaya.events.spi

## Class BaseConfigEvent<T>

- java.lang.Object
- - org.apache.tamaya.events.spi.BaseConfigEvent<T>

- Type Parameters:
    `T` - the vent type
  All Implemented Interfaces:
    ConfigEvent<T>

      public abstract class BaseConfigEvent<T>
      extends Object
      implements ConfigEvent<T>

  Abstract base class for implementing your own configuration events.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected T` | `paylod`
    `protected long` | `timestamp`
    `protected String` | `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseConfigEvent(T paylod, Class<T> type)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getResource()` Get the underlying property provider/configuration.
    `Class<T>` | `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.
    `String` | `getVersion()` Get the version relative to the observed resource.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### timestamp

          protected long timestamp

    - #### version

          protected String version

    - #### paylod

          protected final T paylod

  - ### Constructor Detail

    - #### BaseConfigEvent

          public BaseConfigEvent(T paylod,
                         Class<T> type)

  - ### Method Detail

    - #### getResourceType

          public Class<T> 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<T>`
      Returns:
        the resource type.

    - #### getResource

          public T getResource()

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

    - #### getVersion

          public String getVersion()

      Description copied from interface: `ConfigEvent`
      Get the version relative to the observed resource. The version is required to be unique for each change emmitted for a resource. There is no further requirement how this uniqueness is modelled, so returning a UUID is a completely valid strategy.
      Specified by:
        `getVersion` in interface `ConfigEvent<T>`
      Returns:
        the base version.

    - #### getTimestamp

          public long getTimestamp()

      Description copied from interface: `ConfigEvent`
      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<T>`
      Returns:
        the timestamp, when this changeset was created.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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