org.apache.directory.shared.ldap.message
Enum ScopeEnum

java.lang.Object
  extended by java.lang.Enum<ScopeEnum>
      extended by org.apache.directory.shared.ldap.message.ScopeEnum
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ScopeEnum>

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

Type-safe scope parameter enumeration.

Version:
$Revision: 476896 $
Author:
Apache Directory Project

Enum Constant Summary
BASE_OBJECT
          Search scope parameter value for base object search
SINGLE_LEVEL
          Search scope parameter value for single level search
WHOLE_SUBTREE
          Search scope parameter value for whole subtree level search
 
Method Summary
static ScopeEnum getScope(int value)
          Gets the enum corresponding to the given integer value.
static ScopeEnum getScope(javax.naming.directory.SearchControls controls)
          Gets the type safe enumeration constant corresponding to a SearchControls scope value.
 int getValue()
          Gets the LdapValue for the scope enumeration as opposed to the JNDI value which is returned using getValue().
static ScopeEnum valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ScopeEnum[] 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

BASE_OBJECT

public static final ScopeEnum BASE_OBJECT
Search scope parameter value for base object search


SINGLE_LEVEL

public static final ScopeEnum SINGLE_LEVEL
Search scope parameter value for single level search


WHOLE_SUBTREE

public static final ScopeEnum WHOLE_SUBTREE
Search scope parameter value for whole subtree level search

Method Detail

values

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

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

valueOf

public static ScopeEnum 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

getValue

public int getValue()
Gets the LdapValue for the scope enumeration as opposed to the JNDI value which is returned using getValue().

Returns:
the LDAP enumeration value for the scope parameter on a search request.

getScope

public static ScopeEnum getScope(javax.naming.directory.SearchControls controls)
Gets the type safe enumeration constant corresponding to a SearchControls scope value.

Parameters:
controls - the SearchControls whose scope value we convert to enum
Returns:
the SopeEnum for the scope int value

getScope

public static ScopeEnum getScope(int value)
Gets the enum corresponding to the given integer value.

Parameters:
value - The integer we want the corresponding enum
Returns:
The enumeration element associated with the given integer


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.