org.apache.geronimo.javamail.store.imap
Class Rights

java.lang.Object
  extended by org.apache.geronimo.javamail.store.imap.Rights
All Implemented Interfaces:
Cloneable

public class Rights
extends Object
implements Cloneable

Represents a set of rights associated with a user to manipulate the IMAP Store.


Nested Class Summary
static class Rights.Right
          An individual right for IMAP Store manipulation.
 
Constructor Summary
Rights()
          Construct an empty set of Rights.
Rights(Rights.Right right)
          Construct a Rights set from a single Right instance.
Rights(Rights list)
          Construct a set of rights from an existing Rights set.
Rights(String list)
          Construct a Rights et from a character string.
 
Method Summary
 void add(Rights.Right right)
          Add a single Right to the set.
 void add(Rights list)
          Merge a Rights set with this set.
 Object clone()
          Clone a set of Rights.
 boolean contains(Rights.Right right)
          Test if a Rights set contains a given Right.
 boolean contains(Rights list)
          Test if this Rights set contains all of the Rights contained in another set.
 boolean equals(Rights list)
          Test if two Rights sets are equivalent.
 Rights[] getRights()
          Get an array of Rights contained in the set.
 int hashCode()
          Compute a hashCode for the Rights set.
 void remove(Rights.Right right)
          Remove a Right from the set.
 void remove(Rights list)
          Remove a set of rights from the set.
 String toString()
          Return a string value for the Rights set.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rights

public Rights()
Construct an empty set of Rights.


Rights

public Rights(Rights.Right right)
Construct a Rights set from a single Right instance.

Parameters:
right - The source Right.

Rights

public Rights(Rights list)
Construct a set of rights from an existing Rights set. This will copy the rights values.

Parameters:
list - The source Rights instance.

Rights

public Rights(String list)
Construct a Rights et from a character string. Each character in the string represents an individual Right.

Parameters:
list - The source set of rights.
Method Detail

add

public void add(Rights.Right right)
Add a single Right to the set.

Parameters:
right - The new Right. If the Rigtht is already part of the Set, this is a nop.

add

public void add(Rights list)
Merge a Rights set with this set. Duplicates are eliminated.

Parameters:
list - The source for the added Rights.

clone

public Object clone()
Clone a set of Rights.

Overrides:
clone in class Object

contains

public boolean contains(Rights.Right right)
Test if a Rights set contains a given Right.

Parameters:
right - The Right instance to test.
Returns:
true if the Right exists in the Set, false otherwise.

contains

public boolean contains(Rights list)
Test if this Rights set contains all of the Rights contained in another set.

Parameters:
list - The source Rights set for the test.
Returns:
true if all of the Rights in the source set exist in the target set.

equals

public boolean equals(Rights list)
Test if two Rights sets are equivalent.

Parameters:
list - The source rights set.
Returns:
true if both Rigths sets contain the same Rights values.

getRights

public Rights[] getRights()
Get an array of Rights contained in the set.

Returns:
An array of Rights[] values.

hashCode

public int hashCode()
Compute a hashCode for the Rights set.

Overrides:
hashCode in class Object
Returns:
The computed hashCode.

remove

public void remove(Rights.Right right)
Remove a Right from the set.

Parameters:
right - The single Right to remove.

remove

public void remove(Rights list)
Remove a set of rights from the set.

Parameters:
list - The list of rights to be removed.

toString

public String toString()
Return a string value for the Rights set. The string value is the concatenation of the single-character Rights names.

Overrides:
toString in class Object
Returns:
The string representation of this Rights set.


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