Record Class Datapoint

java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.Datapoint
Record Components:
x - x
y - y
z - z
script - script

@Internal public record Datapoint(@Nullable com.google.gson.JsonPrimitive x, @Nullable com.google.gson.JsonPrimitive y, @Nullable com.google.gson.JsonPrimitive z, @Nullable String script) extends Record
A raw JSON vector.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Datapoint(@Nullable com.google.gson.JsonPrimitive x, @Nullable com.google.gson.JsonPrimitive y, @Nullable com.google.gson.JsonPrimitive z, @Nullable String script)
    Creates an instance of a Datapoint record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Checks this datapoint has script
    @NotNull String
    Gets script
    @NotNull FloatFunction<org.joml.Vector3f>
    toFunction(@NotNull ModelLoadContext context)
    Creates vector function
    final String
    Returns a string representation of this record class.
    @Nullable com.google.gson.JsonPrimitive
    x()
    Returns the value of the x record component.
    @Nullable com.google.gson.JsonPrimitive
    y()
    Returns the value of the y record component.
    @Nullable com.google.gson.JsonPrimitive
    z()
    Returns the value of the z record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Datapoint

      public Datapoint(@Nullable @Nullable com.google.gson.JsonPrimitive x, @Nullable @Nullable com.google.gson.JsonPrimitive y, @Nullable @Nullable com.google.gson.JsonPrimitive z, @Nullable @Nullable String script)
      Creates an instance of a Datapoint record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
      script - the value for the script record component
  • Method Details

    • hasScript

      public boolean hasScript()
      Checks this datapoint has script
      Returns:
      has script
    • script

      @NotNull public @NotNull String script()
      Gets script
      Returns:
      script
    • toFunction

      @NotNull public @NotNull FloatFunction<org.joml.Vector3f> toFunction(@NotNull @NotNull ModelLoadContext context)
      Creates vector function
      Parameters:
      context - context
      Returns:
      vector function
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • x

      @Nullable public @Nullable com.google.gson.JsonPrimitive x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      @Nullable public @Nullable com.google.gson.JsonPrimitive y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • z

      @Nullable public @Nullable com.google.gson.JsonPrimitive z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component