Package com.reduxrobotics.canand
Record Class CanandSettingsManager.SettingResult
java.lang.Object
java.lang.Record
com.reduxrobotics.canand.CanandSettingsManager.SettingResult
- Record Components:
value
- the setting value, as a longresult
- the result code associated with the operation.
- Enclosing class:
- CanandSettingsManager<T extends CanandSettings>
public static record CanandSettingsManager.SettingResult(long value, CanandSettingsManager.ResultCode result)
extends Record
Record of setting results.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CanandSettingsManager.SettingResult
Invalid singleton.static final CanandSettingsManager.SettingResult
Timeout singleton. -
Constructor Summary
ConstructorDescriptionSettingResult
(long value, CanandSettingsManager.ResultCode result) Creates an instance of aSettingResult
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isValid()
Returns true if the result is valid.result()
Returns the value of theresult
record component.void
toByteArray
(byte[] out) Copies the long-backed value to a byte array.final String
toString()
Returns a string representation of this record class.long
value()
Returns the value of thevalue
record component.
-
Field Details
-
INVALID
Invalid singleton. -
TIMEOUT
Timeout singleton.
-
-
Constructor Details
-
Method Details
-
toByteArray
public void toByteArray(byte[] out) Copies the long-backed value to a byte array.- Parameters:
out
- byte array
-
isValid
public boolean isValid()Returns true if the result is valid.- Returns:
- true on valid, false on invalid.
-
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 '=='. -
value
public long value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-