Record Class Versioned<T>

java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.session.Versioned<T>

public record Versioned<T>(T inner, TransportVersion minimumVersion) extends Record
A wrapper for objects to pass along the minimum transport version available in the cluster (and remotes), esp. when dealing with listeners. Where this object gets consumed, we generally need to assume that all nodes in the cluster (and remotes) are at the minimum transport version, so that we don't use features not supported everywhere.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Versioned(T inner, TransportVersion minimumVersion)
    Creates an instance of a Versioned record class.
  • 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 the value of the inner record component.
    Returns the value of the minimumVersion record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • Versioned

      public Versioned(T inner, TransportVersion minimumVersion)
      Creates an instance of a Versioned record class.
      Parameters:
      inner - the value for the inner record component
      minimumVersion - the value for the minimumVersion record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • inner

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

      public TransportVersion minimumVersion()
      Returns the value of the minimumVersion record component.
      Returns:
      the value of the minimumVersion record component