Package net.pl3x.map.core.markers
Record Class Point
java.lang.Object
java.lang.Record
net.pl3x.map.core.markers.Point
- All Implemented Interfaces:
JsonSerializable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static @NotNull Point
fromJson
(@NotNull com.google.gson.JsonObject obj) final int
hashCode()
Returns a hash code value for this object.static @NotNull Point
of
(double x, double z) static @NotNull Point
of
(int x, int z) @NotNull com.google.gson.JsonObject
toJson()
Jsonify this object.final String
toString()
Returns a string representation of this record class.int
x()
Returns the value of thex
record component.int
z()
Returns the value of thez
record component.
-
Field Details
-
ZERO
-
-
Constructor Details
-
Point
public Point(int x, int z) Creates an instance of aPoint
record class.- Parameters:
x
- the value for thex
record componentz
- the value for thez
record component
-
-
Method Details
-
of
-
of
-
toJson
@NotNull public @NotNull 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 int x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
z
public int z()Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-