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 thebanTime
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of themaxHearts
record component.Returns the value of theminHearts
record component.Returns the value of thepermission
record component.Returns the value of thereturnHearts
record component.final String
toString()
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 aLifestealerUserRulesGroup
record class.- Parameters:
permission
- the value for thepermission
record componentmaxHearts
- the value for themaxHearts
record componentminHearts
- the value for theminHearts
record componentbanTime
- the value for thebanTime
record componentreturnHearts
- the value for thereturnHearts
record 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 thepermission
record component.- Returns:
- the value of the
permission
record component
-
maxHearts
Returns the value of themaxHearts
record component.- Returns:
- the value of the
maxHearts
record component
-
minHearts
Returns the value of theminHearts
record component.- Returns:
- the value of the
minHearts
record component
-
banTime
Returns the value of thebanTime
record component.- Returns:
- the value of the
banTime
record component
-
returnHearts
Returns the value of thereturnHearts
record component.- Returns:
- the value of the
returnHearts
record component
-