Record Class MessagePriority
java.lang.Object
java.lang.Record
org.j7m.middleware.api.messaging.MessagePriority
- Record Components:
value- priority value from -1000 through 1000
- All Implemented Interfaces:
Serializable, Comparable<MessagePriority>
public record MessagePriority(int value)
extends Record
implements Serializable, Comparable<MessagePriority>
Message priority, where larger values lease first.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(MessagePriority other) Compares this priority to another priority.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.
-
Field Details
-
NORMAL
Default priority.
-
-
Constructor Details
-
MessagePriority
public MessagePriority(int value) Creates a priority.- Throws:
IllegalArgumentException- when the value is outside the supported range
-
-
Method Details
-
compareTo
Compares this priority to another priority.- Specified by:
compareToin interfaceComparable<MessagePriority>- Parameters:
other- other priority- Returns:
- negative, zero, or positive according to normal comparison rules
-
toString
-
hashCode
-
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 with thecomparemethod from their corresponding wrapper classes. -
value
-