Package net.minecraft.commands
Record Class PermissionSource.Check<T extends PermissionSource>
java.lang.Object
java.lang.Record
net.minecraft.commands.PermissionSource.Check<T>
- All Implemented Interfaces:
Predicate<T>
,PermissionCheck<T>
- Enclosing interface:
PermissionSource
public static record PermissionSource.Check<T extends PermissionSource>(int requiredLevel)
extends Record
implements PermissionCheck<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The field for therequiredLevel
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of therequiredLevel
record component.boolean
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
requiredLevel
private final int requiredLevelThe field for therequiredLevel
record component.
-
-
Constructor Details
-
Check
public Check(int requiredLevel) Creates an instance of aCheck
record class.- Parameters:
requiredLevel
- the value for therequiredLevel
record component
-
-
Method Details
-
test
- Specified by:
test
in interfacePredicate<T extends PermissionSource>
-
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 with '=='. -
requiredLevel
public int requiredLevel()Returns the value of therequiredLevel
record component.- Specified by:
requiredLevel
in interfacePermissionCheck<T extends PermissionSource>
- Returns:
- the value of the
requiredLevel
record component
-