org.ogf.saga.permissions
Enum Permission

java.lang.Object
  extended by java.lang.Enum<Permission>
      extended by org.ogf.saga.permissions.Permission
All Implemented Interfaces:
Serializable, Comparable<Permission>

public enum Permission
extends Enum<Permission>

Enumerates all permission values. These flags are meant to be or-ed together, resulting in an integer, so methods are added to test for presence and or-ing.


Enum Constant Summary
ALL
           
EXEC
           
NONE
           
OWNER
           
QUERY
           
READ
           
WRITE
           
 
Method Summary
 int getValue()
          Returns the integer value of this permission.
 boolean isSet(int val)
          Tests for the presence of this flag in the specified value.
 int or(int val)
          Returns the result of or-ing this flag into an integer.
 int or(Permission val)
          Returns the result of or-ing this flag into another.
static Permission valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Permission[] 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 Permission NONE

QUERY

public static final Permission QUERY

READ

public static final Permission READ

WRITE

public static final Permission WRITE

EXEC

public static final Permission EXEC

OWNER

public static final Permission OWNER

ALL

public static final Permission ALL
Method Detail

values

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

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

valueOf

public static Permission valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getValue

public int getValue()
Returns the integer value of this permission.

Returns:
the integer value.

or

public int or(int val)
Returns the result of or-ing this flag into an integer.

Parameters:
val - the value to OR this enumeration value into.
Returns:
the result of or-ing this flag into the integer parameter.

or

public int or(Permission val)
Returns the result of or-ing this flag into another.

Parameters:
val - the value to OR this enumeration value into.
Returns:
the result of or-ing this flag into the integer parameter.

isSet

public boolean isSet(int val)
Tests for the presence of this flag in the specified value.

Parameters:
val - the value.
Returns:
true if this flag is present.


Copyright © 2014 Open Grid Forum. All rights reserved.