Record Class NativeInfo<K extends Comparable<K>,N>

java.lang.Object
java.lang.Record
io.aiven.commons.kafka.connector.common.NativeInfo<K,N>
Type Parameters:
K - The native key type.
N - The native object type.
Record Components:
nativeKey - The native key for the storage.
nativeItem - the native item for the storage.
All Implemented Interfaces:
Comparable<NativeInfo<K,N>>

public record NativeInfo<K extends Comparable<K>,N>(K extends Comparable<K> nativeKey, N nativeItem) extends Record implements Comparable<NativeInfo<K,N>>
Information about the Native object. The NativeInfo ties a Native key to a Native object. In many cases the storage provides a key directly to the native object and this implementation can simply call that. In other cases the key and object are separate and the implementation will tie them together. In the streaming data case there is no key to return to so the key will be constructed when the object is available.
  • Constructor Details

    • NativeInfo

      public NativeInfo(K nativeKey, N nativeItem)
      Creates an instance of a NativeInfo record class.
      Parameters:
      nativeKey - the value for the nativeKey record component
      nativeItem - the value for the nativeItem record component
  • Method Details

    • compareTo

      public int compareTo(NativeInfo<K,N> o)
      Specified by:
      compareTo in interface Comparable<K extends Comparable<K>>
    • 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.
    • nativeKey

      public K nativeKey()
      Returns the value of the nativeKey record component.
      Returns:
      the value of the nativeKey record component
    • nativeItem

      public N nativeItem()
      Returns the value of the nativeItem record component.
      Returns:
      the value of the nativeItem record component