Package com.mimecast.robin.queue
Record Class QueueMutation<T extends Serializable>
java.lang.Object
java.lang.Record
com.mimecast.robin.queue.QueueMutation<T>
- Type Parameters:
T- payload type
public record QueueMutation<T extends Serializable>(QueueMutationType type, QueueItem<T extends Serializable> item, long nextAttemptAtEpochSeconds, String lastError)
extends Record
One queue-state mutation produced by a dequeue worker.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theitemrecord component.private final StringThe field for thelastErrorrecord component.private final longThe field for thenextAttemptAtEpochSecondsrecord component.private final QueueMutationTypeThe field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionQueueMutation(QueueMutationType type, QueueItem<T> item, long nextAttemptAtEpochSeconds, String lastError) Creates an instance of aQueueMutationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Serializable>
QueueMutation<T> acknowledge(QueueItem<T> item) static <T extends Serializable>
QueueMutation<T> final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.Returns the value of thelastErrorrecord component.longReturns the value of thenextAttemptAtEpochSecondsrecord component.static <T extends Serializable>
QueueMutation<T> reschedule(QueueItem<T> item, long nextAttemptAtEpochSeconds, String lastError) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
type
The field for thetyperecord component. -
item
The field for theitemrecord component. -
nextAttemptAtEpochSeconds
private final long nextAttemptAtEpochSecondsThe field for thenextAttemptAtEpochSecondsrecord component. -
lastError
The field for thelastErrorrecord component.
-
-
Constructor Details
-
QueueMutation
public QueueMutation(QueueMutationType type, QueueItem<T> item, long nextAttemptAtEpochSeconds, String lastError) Creates an instance of aQueueMutationrecord class.- Parameters:
type- the value for thetyperecord componentitem- the value for theitemrecord componentnextAttemptAtEpochSeconds- the value for thenextAttemptAtEpochSecondsrecord componentlastError- the value for thelastErrorrecord component
-
-
Method Details
-
acknowledge
-
reschedule
public static <T extends Serializable> QueueMutation<T> reschedule(QueueItem<T> item, long nextAttemptAtEpochSeconds, String lastError) -
dead
-
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 '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
nextAttemptAtEpochSeconds
public long nextAttemptAtEpochSeconds()Returns the value of thenextAttemptAtEpochSecondsrecord component.- Returns:
- the value of the
nextAttemptAtEpochSecondsrecord component
-
lastError
Returns the value of thelastErrorrecord component.- Returns:
- the value of the
lastErrorrecord component
-