Record Class Mutation

java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.block.Mutation

public record Mutation(@NotNull String id, @NotNull String prefix, @NotNull String displayName, @NotNull String hexColor, double incomeMultiplier, double mysteryUnboxChance, int tierOrder, @Nullable String nextMutationId) extends Record
Definition of a block mutation tier (built-in: normal, golden, diamond, rainbow; extensible by addons).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Mutation
     
    static final Mutation
     
    static final Mutation
     
    static final Mutation
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Mutation(@NotNull String id, @NotNull String prefix, @NotNull String displayName, @NotNull String hexColor, double incomeMultiplier, double mysteryUnboxChance, int tierOrder, @Nullable String nextMutationId)
    Creates an instance of a Mutation record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    Returns the value of the displayName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull String
    Returns the value of the hexColor record component.
    @NotNull String
    id()
    Returns the value of the id record component.
    double
    Returns the value of the incomeMultiplier record component.
    double
    Returns the value of the mysteryUnboxChance record component.
    @Nullable String
    Returns the value of the nextMutationId record component.
    @NotNull String
    Returns the value of the prefix record component.
    int
    Returns the value of the tierOrder record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • NORMAL

      public static final Mutation NORMAL
    • GOLDEN

      public static final Mutation GOLDEN
    • DIAMOND

      public static final Mutation DIAMOND
    • RAINBOW

      public static final Mutation RAINBOW
  • Constructor Details

    • Mutation

      public Mutation(@NotNull @NotNull String id, @NotNull @NotNull String prefix, @NotNull @NotNull String displayName, @NotNull @NotNull String hexColor, double incomeMultiplier, double mysteryUnboxChance, int tierOrder, @Nullable @Nullable String nextMutationId)
      Creates an instance of a Mutation record class.
      Parameters:
      id - the value for the id record component
      prefix - the value for the prefix record component
      displayName - the value for the displayName record component
      hexColor - the value for the hexColor record component
      incomeMultiplier - the value for the incomeMultiplier record component
      mysteryUnboxChance - the value for the mysteryUnboxChance record component
      tierOrder - the value for the tierOrder record component
      nextMutationId - the value for the nextMutationId record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • id

      @NotNull public @NotNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • prefix

      @NotNull public @NotNull String prefix()
      Returns the value of the prefix record component.
      Returns:
      the value of the prefix record component
    • displayName

      @NotNull public @NotNull String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • hexColor

      @NotNull public @NotNull String hexColor()
      Returns the value of the hexColor record component.
      Returns:
      the value of the hexColor record component
    • incomeMultiplier

      public double incomeMultiplier()
      Returns the value of the incomeMultiplier record component.
      Returns:
      the value of the incomeMultiplier record component
    • mysteryUnboxChance

      public double mysteryUnboxChance()
      Returns the value of the mysteryUnboxChance record component.
      Returns:
      the value of the mysteryUnboxChance record component
    • tierOrder

      public int tierOrder()
      Returns the value of the tierOrder record component.
      Returns:
      the value of the tierOrder record component
    • nextMutationId

      @Nullable public @Nullable String nextMutationId()
      Returns the value of the nextMutationId record component.
      Returns:
      the value of the nextMutationId record component