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 Summary
ConstructorsConstructorDescriptionNativeInfo(K nativeKey, N nativeItem) Creates an instance of aNativeInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(NativeInfo<K, N> o) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenativeItemrecord component.Returns the value of thenativeKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NativeInfo
Creates an instance of aNativeInforecord class.- Parameters:
nativeKey- the value for thenativeKeyrecord componentnativeItem- the value for thenativeItemrecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<K extends Comparable<K>>
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
nativeKey
Returns the value of thenativeKeyrecord component.- Returns:
- the value of the
nativeKeyrecord component
-
nativeItem
Returns the value of thenativeItemrecord component.- Returns:
- the value of the
nativeItemrecord component
-