Record Class LifestealerUserRulesGroup

java.lang.Object
java.lang.Record
dev.chicoferreira.lifestealer.user.rules.LifestealerUserRulesGroup
Record Components:
permission - the permission the player needs to have for this group to be applied
maxHearts - the maximum amount of hearts a player can have
minHearts - the minimum amount of hearts a player can have
banTime - the duration that a player will be banned if they have less than the minimum amount of hearts
returnHearts - the amount of hearts a player will have when they return from a ban

@ConfigSerializable public record LifestealerUserRulesGroup(String permission, Optional<Integer> maxHearts, Optional<Integer> minHearts, Optional<Duration> banTime, Optional<Integer> returnHearts) extends Record
Similar to LifestealerUserRules, but with an additional permission field and optional fields. These will combine with the LifestealerUserRules to create a final set of rules for a player based on their permissions.
  • Constructor Details

  • 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.
    • permission

      public String permission()
      Returns the value of the permission record component.
      Returns:
      the value of the permission record component
    • maxHearts

      public Optional<Integer> maxHearts()
      Returns the value of the maxHearts record component.
      Returns:
      the value of the maxHearts record component
    • minHearts

      public Optional<Integer> minHearts()
      Returns the value of the minHearts record component.
      Returns:
      the value of the minHearts record component
    • banTime

      public Optional<Duration> banTime()
      Returns the value of the banTime record component.
      Returns:
      the value of the banTime record component
    • returnHearts

      public Optional<Integer> returnHearts()
      Returns the value of the returnHearts record component.
      Returns:
      the value of the returnHearts record component