org.basex.core
Enum Perm

java.lang.Object
  extended by java.lang.Enum<Perm>
      extended by org.basex.core.Perm
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Perm>

public enum Perm
extends java.lang.Enum<Perm>

User permissions.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Enum Constant Summary
ADMIN
          Admin permission (global).
CREATE
          Create permission (global).
NONE
          No permissions.
READ
          Read permission (local+global).
WRITE
          Write permission (local+global).
 
Field Summary
 int num
          Permission.
 
Method Summary
static Perm get(java.lang.String s)
          Returns a permission matching the specified string.
static Perm valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Perm[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final Perm NONE
No permissions.


READ

public static final Perm READ
Read permission (local+global).


WRITE

public static final Perm WRITE
Write permission (local+global).


CREATE

public static final Perm CREATE
Create permission (global).


ADMIN

public static final Perm ADMIN
Admin permission (global).

Field Detail

num

public final int num
Permission.

Method Detail

values

public static Perm[] 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 (Perm c : Perm.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Perm 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 name
java.lang.NullPointerException - if the argument is null

get

public static Perm get(java.lang.String s)
Returns a permission matching the specified string.

Parameters:
s - permission string
Returns:
permission, or ADMIN if no match is found