org.apache.directory.shared.kerberos.flags
Class AbstractKerberosFlags

java.lang.Object
  extended by org.apache.directory.shared.asn1.util.BitString
      extended by org.apache.directory.shared.kerberos.flags.AbstractKerberosFlags
Direct Known Subclasses:
Options, TicketFlags

public abstract class AbstractKerberosFlags
extends org.apache.directory.shared.asn1.util.BitString

An implementation of a BitString for any KerberosFlags. The different values are stored in an int, as there can't be more than 32 flags (TicketFlag). Some basic operations are implemented in this abstract class, like those manipulating flags.

Author:
Apache Directory Project

Field Summary
static int MAX_SIZE
          The maximum size of the BitString as specified for Kerberos flags.
protected  int value
          The associated value
 
Fields inherited from class org.apache.directory.shared.asn1.util.BitString
EMPTY_STRING
 
Constructor Summary
AbstractKerberosFlags()
          Standard constructor, which create a BitString containing 32 bits
AbstractKerberosFlags(byte[] flags)
          Standard constructor, taking a byte array, 32 bits
AbstractKerberosFlags(int value)
          Standard constructor, which create a BitString containing 32 bits
 
Method Summary
 void clearFlag(int flag)
          clear a flag in a list of flags
 void clearFlag(KerberosFlag flag)
          clear a flag in a list of flags
 boolean equals(Object obj)
           
 int getIntValue()
          Returns the int value associated with the flags
 int hashCode()
           
 boolean isFlagSet(int flag)
          Check if a flag is set
static boolean isFlagSet(int flags, int flag)
          Check if a flag is set
 boolean isFlagSet(KerberosFlag flag)
          Check if a flag is set for the actual value
 void setData(int value)
          Store the flags contained in the given integer value
 void setFlag(int flag)
          Set a flag in a list of flags
 void setFlag(KerberosFlag flag)
          Set a flag in a list of flags
 
Methods inherited from class org.apache.directory.shared.asn1.util.BitString
clearBit, getBit, getData, getUnusedBits, setBit, setData, size, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_SIZE

public static final int MAX_SIZE
The maximum size of the BitString as specified for Kerberos flags.

See Also:
Constant Field Values

value

protected int value
The associated value

Constructor Detail

AbstractKerberosFlags

public AbstractKerberosFlags()
Standard constructor, which create a BitString containing 32 bits


AbstractKerberosFlags

public AbstractKerberosFlags(int value)
Standard constructor, which create a BitString containing 32 bits

Parameters:
value - The flags to store

AbstractKerberosFlags

public AbstractKerberosFlags(byte[] flags)
Standard constructor, taking a byte array, 32 bits

Method Detail

setData

public void setData(int value)
Store the flags contained in the given integer value

Parameters:
value - The list of flags to set, as a int

getIntValue

public int getIntValue()
Returns the int value associated with the flags


isFlagSet

public static boolean isFlagSet(int flags,
                                int flag)
Check if a flag is set

Parameters:
flags - The flags to test
flag - The flag to check
Returns:
True if the flag is set in the list of flags

isFlagSet

public boolean isFlagSet(KerberosFlag flag)
Check if a flag is set for the actual value

Parameters:
flag - The flag to check
Returns:
True if the flag is set in the list of flags

isFlagSet

public boolean isFlagSet(int flag)
Check if a flag is set

Parameters:
flag - The flags to test
Returns:
True if the flag is set in the list of flags

setFlag

public void setFlag(KerberosFlag flag)
Set a flag in a list of flags

Parameters:
flag - The flag to set

setFlag

public void setFlag(int flag)
Set a flag in a list of flags

Parameters:
flag - The flag to set

clearFlag

public void clearFlag(KerberosFlag flag)
clear a flag in a list of flags

Parameters:
flag - The flag to set

clearFlag

public void clearFlag(int flag)
clear a flag in a list of flags

Parameters:
flag - The flag to set

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.