Record Class SharedVehicleControls.Inputs
java.lang.Object
java.lang.Record
eu.comosus.ananas.quirkyvehiclesframework.controls.SharedVehicleControls.Inputs
- Enclosing class:
SharedVehicleControls
public static record SharedVehicleControls.Inputs(boolean left, boolean right, boolean forward, boolean backward)
extends Record
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyteasByte()booleanbackward()Returns the value of thebackwardrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanforward()Returns the value of theforwardrecord component.final inthashCode()Returns a hash code value for this object.booleanleft()Returns the value of theleftrecord component.booleanright()Returns the value of therightrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
Inputs
public Inputs(byte inputAsByte) -
Inputs
public Inputs(boolean left, boolean right, boolean forward, boolean backward) Creates an instance of aInputsrecord class.- Parameters:
left- the value for theleftrecord componentright- the value for therightrecord componentforward- the value for theforwardrecord componentbackward- the value for thebackwardrecord component
-
-
Method Details
-
asByte
public byte asByte() -
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. All components in this record class are compared with '=='. -
left
public boolean left()Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
public boolean right()Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
forward
public boolean forward()Returns the value of theforwardrecord component.- Returns:
- the value of the
forwardrecord component
-
backward
public boolean backward()Returns the value of thebackwardrecord component.- Returns:
- the value of the
backwardrecord component
-