Enum DefaultPermissionHandler
- java.lang.Object
-
- java.lang.Enum<DefaultPermissionHandler>
-
- net.minecraftforge.server.permission.DefaultPermissionHandler
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DefaultPermissionHandler>
,IPermissionHandler
public enum DefaultPermissionHandler extends java.lang.Enum<DefaultPermissionHandler> implements IPermissionHandler
Default implementation of PermissionAPI.hasPermission(GameProfile, String, IContext)
is based on DefaultPermissionLevel- See Also:
IPermissionHandler
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description private static java.util.HashMap<java.lang.String,java.lang.String>
DESCRIPTION_MAP
private static java.util.HashMap<java.lang.String,DefaultPermissionLevel>
PERMISSION_LEVEL_MAP
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultPermissionHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultPermissionLevel
getDefaultPermissionLevel(java.lang.String node)
java.lang.String
getNodeDescription(java.lang.String node)
java.util.Collection<java.lang.String>
getRegisteredNodes()
boolean
hasPermission(com.mojang.authlib.GameProfile profile, java.lang.String node, IContext context)
void
registerNode(java.lang.String node, DefaultPermissionLevel level, java.lang.String desc)
static DefaultPermissionHandler
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DefaultPermissionHandler[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final DefaultPermissionHandler INSTANCE
-
-
Field Detail
-
PERMISSION_LEVEL_MAP
private static final java.util.HashMap<java.lang.String,DefaultPermissionLevel> PERMISSION_LEVEL_MAP
-
DESCRIPTION_MAP
private static final java.util.HashMap<java.lang.String,java.lang.String> DESCRIPTION_MAP
-
-
Method Detail
-
values
public static DefaultPermissionHandler[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultPermissionHandler c : DefaultPermissionHandler.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultPermissionHandler valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
registerNode
public void registerNode(java.lang.String node, DefaultPermissionLevel level, java.lang.String desc)
Description copied from interface:IPermissionHandler
- Specified by:
registerNode
in interfaceIPermissionHandler
-
getRegisteredNodes
public java.util.Collection<java.lang.String> getRegisteredNodes()
- Specified by:
getRegisteredNodes
in interfaceIPermissionHandler
- Returns:
- Immutable collection of all registered nodes
-
hasPermission
public boolean hasPermission(com.mojang.authlib.GameProfile profile, java.lang.String node, @Nullable IContext context)
Description copied from interface:IPermissionHandler
- Specified by:
hasPermission
in interfaceIPermissionHandler
-
getNodeDescription
public java.lang.String getNodeDescription(java.lang.String node)
- Specified by:
getNodeDescription
in interfaceIPermissionHandler
- Parameters:
node
- Permission node- Returns:
- Description of the node. "" in case this node doesn't have a decription
- See Also:
IPermissionHandler.registerNode(String, DefaultPermissionLevel, String)
-
getDefaultPermissionLevel
public DefaultPermissionLevel getDefaultPermissionLevel(java.lang.String node)
- Returns:
- The default permission level of a node. If the permission isn't registred, it will return NONE
-
-