com.sun.mail.imap
クラス Rights

java.lang.Object
  上位を拡張 com.sun.mail.imap.Rights
すべての実装されたインタフェース:
Cloneable

public final class Rights
extends Object
implements Cloneable

Rights クラスは認証識別子(例えば、ユーザやグループ)への権利セットを表します。

right は Rights.Right のインナークラスによって表されます。

A set of standard rights are predefined (see RFC 2086). Most folder implementations are expected to support these rights. Some implementations may also support site-defined rights.

以下のコードのサンプルはフォルダへのあなたの権限を調べる方法を示します。

 
 Rights rights = folder.myRights();
 
 // 自分がこのフォルダに書き込めるかどうか検査します。
 if (rights.contains(Rights.Right.WRITE))
        System.out.println("Can write folder");
 
 // フォルダの書き込み権限以外の私の全ての権限をジョーに与えます。
 // Now give Joe all my rights, except the ability to write the folder
 rights.remove(Rights.Right.WRITE);
 ACL acl = new ACL("joe", rights);
 folder.setACL(acl);
 


入れ子のクラスの概要
static class Rights.Right
          このインナークラスは個々の権限を表します。
 
コンストラクタの概要
Rights()
          Construct an empty Rights object.
Rights(Rights.Right right)
          Construct a Rights object initialized with the given right.
Rights(Rights rights)
          Construct a Rights object initialized with the given rights.
Rights(String rights)
          Construct a Rights object initialized with the given rights.
 
メソッドの概要
 void add(Rights.Right right)
          Add the specified right to this Rights object.
 void add(Rights rights)
          Add all the rights in the given Rights object to this Rights object.
 Object clone()
          Returns a clone of this Rights object.
 boolean contains(Rights.Right right)
          Check whether the specified right is present in this Rights object.
 boolean contains(Rights rights)
          Check whether all the rights in the specified Rights object are present in this Rights object.
 boolean equals(Object obj)
          Check whether the two Rights objects are equal.
 Rights.Right[] getRights()
          Return all the rights in this Rights object.
 int hashCode()
          Compute a hash code for this Rights object.
 void remove(Rights.Right right)
          Remove the specified right from this Rights object.
 void remove(Rights rights)
          Remove all rights in the given Rights object from this Rights object.
 String toString()
           
 
クラス java.lang.Object から継承されたメソッド
finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Rights

public Rights()
Construct an empty Rights object.


Rights

public Rights(Rights rights)
Construct a Rights object initialized with the given rights.

パラメータ:
rights - the rights for initialization

Rights

public Rights(String rights)
Construct a Rights object initialized with the given rights.

パラメータ:
rights - the rights for initialization

Rights

public Rights(Rights.Right right)
Construct a Rights object initialized with the given right.

パラメータ:
right - the right for initialization
メソッドの詳細

add

public void add(Rights.Right right)
Add the specified right to this Rights object.

パラメータ:
right - the right to add

add

public void add(Rights rights)
Add all the rights in the given Rights object to this Rights object.

パラメータ:
rights - Rights object

remove

public void remove(Rights.Right right)
Remove the specified right from this Rights object.

パラメータ:
right - the right to be removed

remove

public void remove(Rights rights)
Remove all rights in the given Rights object from this Rights object.

パラメータ:
rights - the right to be removed

contains

public boolean contains(Rights.Right right)
Check whether the specified right is present in this Rights object.

戻り値:
true of the given right is present, otherwise false.

contains

public boolean contains(Rights rights)
Check whether all the rights in the specified Rights object are present in this Rights object.

戻り値:
true if all rights in the given Rights object are present, otherwise false.

equals

public boolean equals(Object obj)
Check whether the two Rights objects are equal.

オーバーライド:
クラス Object 内の equals
戻り値:
true if they're equal

hashCode

public int hashCode()
Compute a hash code for this Rights object.

オーバーライド:
クラス Object 内の hashCode
戻り値:
ハッシュコード

getRights

public Rights.Right[] getRights()
Return all the rights in this Rights object. Returns an array of size zero if no rights are set.

戻り値:
array of Rights.Right objects representing rights

clone

public Object clone()
Returns a clone of this Rights object.

オーバーライド:
クラス Object 内の clone

toString

public String toString()
オーバーライド:
クラス Object 内の toString