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 appliedmaxHearts- the maximum amount of hearts a player can haveminHearts- the minimum amount of hearts a player can havebanTime- the duration that a player will be banned if they have less than the minimum amount of heartsreturnHearts- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbanTime()Returns the value of thebanTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themaxHeartsrecord component.Returns the value of theminHeartsrecord component.Returns the value of thepermissionrecord component.Returns the value of thereturnHeartsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LifestealerUserRulesGroup
public LifestealerUserRulesGroup(String permission, Optional<Integer> maxHearts, Optional<Integer> minHearts, Optional<Duration> banTime, Optional<Integer> returnHearts) Creates an instance of aLifestealerUserRulesGrouprecord class.- Parameters:
permission- the value for thepermissionrecord componentmaxHearts- the value for themaxHeartsrecord componentminHearts- the value for theminHeartsrecord componentbanTime- the value for thebanTimerecord componentreturnHearts- the value for thereturnHeartsrecord component
-
-
Method Details
-
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 withObjects::equals(Object,Object). -
permission
Returns the value of thepermissionrecord component.- Returns:
- the value of the
permissionrecord component
-
maxHearts
Returns the value of themaxHeartsrecord component.- Returns:
- the value of the
maxHeartsrecord component
-
minHearts
Returns the value of theminHeartsrecord component.- Returns:
- the value of the
minHeartsrecord component
-
banTime
Returns the value of thebanTimerecord component.- Returns:
- the value of the
banTimerecord component
-
returnHearts
Returns the value of thereturnHeartsrecord component.- Returns:
- the value of the
returnHeartsrecord component
-