Record Class ConfigBindingSnapshot<T>

java.lang.Object
java.lang.Record
org.j7m.middleware.application.api.ConfigBindingSnapshot<T>
Type Parameters:
T - immutable scalar or record type
Record Components:
version - nonnegative source version
value - typed value, possibly null for an absent optional scalar

public record ConfigBindingSnapshot<T>(long version, T value) extends Record
One atomically observed typed configuration value and its source version.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfigBindingSnapshot(long version, T value)
    Rejects negative source versions.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns version information without exposing configuration values.
    Returns the value of the value record component.
    long
    Returns the value of the version record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ConfigBindingSnapshot

      public ConfigBindingSnapshot(long version, T value)
      Rejects negative source versions.
      Throws:
      IllegalArgumentException - if the version is negative
  • Method Details

    • toString

      public String toString()
      Returns version information without exposing configuration values.
      Specified by:
      toString in class Record
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • version

      public long version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • value

      public T value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component