Record Class MechanicWrapper

java.lang.Object
java.lang.Record
org.yuemi.mmomechanics.api.skill.mechanic.MechanicWrapper
Record Components:
mechanic - the mechanic action to run
targeter - the targeter determining where to apply the mechanic
conditions - condition checks that targets must pass

public record MechanicWrapper(@NotNull Mechanic mechanic, @NotNull Targeter targeter, @NotNull Collection<Condition> conditions) extends Record
A wrapper record holding a mechanic, its targeter, and conditional checks.
  • Constructor Details

    • MechanicWrapper

      public MechanicWrapper(@NotNull @NotNull Mechanic mechanic, @NotNull @NotNull Targeter targeter, @NotNull @NotNull Collection<Condition> conditions)
      Creates an instance of a MechanicWrapper record class.
      Parameters:
      mechanic - the value for the mechanic record component
      targeter - the value for the targeter record component
      conditions - the value for the conditions 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. 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.
    • mechanic

      @NotNull public @NotNull Mechanic mechanic()
      Returns the value of the mechanic record component.
      Returns:
      the value of the mechanic record component
    • targeter

      @NotNull public @NotNull Targeter targeter()
      Returns the value of the targeter record component.
      Returns:
      the value of the targeter record component
    • conditions

      @NotNull public @NotNull Collection<Condition> conditions()
      Returns the value of the conditions record component.
      Returns:
      the value of the conditions record component