Class ImmutableClockRecordValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableClockRecordValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,ClockRecordValue
Immutable implementation of
ClockRecordValue.
Use the builder to create immutable instances:
ImmutableClockRecordValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableClockRecordValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableClockRecordValue.static ImmutableClockRecordValuecopyOf(ClockRecordValue instance) Creates an immutable copy of aClockRecordValuevalue.booleanThis instance is equal to all instances ofImmutableClockRecordValuethat have equal attribute values.longgetTime()Returns the value of this clock modification, if any.inthashCode()Returns a lazily computed hash code from attributes:time.toString()Prints the immutable valueClockRecordValuewith attribute values.withTime(long value) Copy the current immutable object by setting a value for thetimeattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getTime
public long getTime()Returns the value of this clock modification, if any.- If the associated intent is a pin, then the time is a Unix timestamp as epoch milliseconds
- If the associated intent is an offset, then time would be the duration in milliseconds
- If the associated intent is a reset, then this value has no meaning, and will be 0
- Specified by:
getTimein interfaceClockRecordValue
-
withTime
Copy the current immutable object by setting a value for thetimeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for time- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableClockRecordValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:time. -
toString
Prints the immutable valueClockRecordValuewith attribute values. -
copyOf
Creates an immutable copy of aClockRecordValuevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ClockRecordValue instance
-
builder
Creates a builder forImmutableClockRecordValue.ImmutableClockRecordValue.builder() .withTime(long) // optionaltime.build();- Returns:
- A new ImmutableClockRecordValue builder
-