Package net.pl3x.map.core.markers
Record Class Vector
java.lang.Object
java.lang.Record
net.pl3x.map.core.markers.Vector
- All Implemented Interfaces:
JsonSerializable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static Vector
fromJson
(com.google.gson.JsonObject obj) final int
hashCode()
Returns a hash code value for this object.static Vector
of
(double x, double z) static Vector
of
(int x, int z) com.google.gson.JsonObject
toJson()
Jsonify this object.final String
toString()
Returns a string representation of this record class.double
x()
Returns the value of thex
record component.double
z()
Returns the value of thez
record component.
-
Constructor Details
-
Vector
public Vector(double x, double z) Creates an instance of aVector
record class.- Parameters:
x
- the value for thex
record componentz
- the value for thez
record component
-
-
Method Details
-
of
-
of
-
toJson
public com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializable
Jsonify this object.- Specified by:
toJson
in interfaceJsonSerializable
- Returns:
- object as json element
-
fromJson
-
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 '=='. -
x
public double x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
z
public double z()Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-