Package com.usatiuk.objects
Record Class JDataVersionedWrapperImpl
java.lang.Object
java.lang.Record
com.usatiuk.objects.JDataVersionedWrapperImpl
- All Implemented Interfaces:
Data<JDataVersionedWrapper>
,MaybeTombstone<JDataVersionedWrapper>
,JDataVersionedWrapper
,Serializable
public record JDataVersionedWrapperImpl(@Nonnull JData data, long version)
extends Record
implements Serializable, JDataVersionedWrapper
Simple wrapper for an already-existing JData object with a version.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJDataVersionedWrapperImpl
(JData data, long version) Creates an instance of aJDataVersionedWrapperImpl
record class. -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.final boolean
Indicates whether some other object is "equal to" this one.int
Returns the estimated size of the object in bytes.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.long
version()
Returns the value of theversion
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.usatiuk.objects.JDataVersionedWrapper
value
-
Constructor Details
-
JDataVersionedWrapperImpl
Creates an instance of aJDataVersionedWrapperImpl
record class.- Parameters:
data
- the value for thedata
record componentversion
- the value for theversion
record component
-
-
Method Details
-
estimateSize
public int estimateSize()Description copied from interface:JDataVersionedWrapper
Returns the estimated size of the object in bytes.- Specified by:
estimateSize
in interfaceJDataVersionedWrapper
- Returns:
- the estimated size of the object in bytes
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
data
Returns the value of thedata
record component.- Specified by:
data
in interfaceJDataVersionedWrapper
- Returns:
- the value of the
data
record component
-
version
public long version()Returns the value of theversion
record component.- Specified by:
version
in interfaceJDataVersionedWrapper
- Returns:
- the value of the
version
record component
-