Record Class Position
public record Position(BigDecimal xPosition, BigDecimal yPosition, BigDecimal zPosition)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPosition
(BigDecimal xPosition, BigDecimal yPosition, BigDecimal zPosition) Creates an instance of aPosition
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.final String
toString()
Returns a string representation of this record class.Returns the value of thexPosition
record component.Returns the value of theyPosition
record component.Returns the value of thezPosition
record component.
-
Constructor Details
-
Position
Creates an instance of aPosition
record class.- Parameters:
xPosition
- the value for thexPosition
record componentyPosition
- the value for theyPosition
record componentzPosition
- the value for thezPosition
record component
-
-
Method Details
-
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 withObjects::equals(Object,Object)
. -
xPosition
Returns the value of thexPosition
record component.- Returns:
- the value of the
xPosition
record component
-
yPosition
Returns the value of theyPosition
record component.- Returns:
- the value of the
yPosition
record component
-
zPosition
Returns the value of thezPosition
record component.- Returns:
- the value of the
zPosition
record component
-