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 booleanIndicates whether some other object is "equal to" this one.static VectorfromJson(com.google.gson.JsonObject obj) final inthashCode()Returns a hash code value for this object.static Vectorof(double x, double z) static Vectorof(int x, int z) com.google.gson.JsonObjecttoJson()Jsonify this object.final StringtoString()Returns a string representation of this record class.doublex()Returns the value of thexrecord component.doublez()Returns the value of thezrecord component.
-
Constructor Details
-
Vector
public Vector(double x, double z) Creates an instance of aVectorrecord class.- Parameters:
x- the value for thexrecord componentz- the value for thezrecord component
-
-
Method Details
-
of
-
of
-
toJson
public com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializableJsonify this object.- Specified by:
toJsonin 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 thexrecord component.- Returns:
- the value of the
xrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-