com.openexchange.mail.dataobjects
Class MailFolderDescription

java.lang.Object
  extended by com.openexchange.mail.dataobjects.MailFolderDescription

public class MailFolderDescription
extends java.lang.Object

MailFolderDescription - A simple object for updating or creating a folder which holds user-modifiable folder attributes.

See the method descriptions of setExists(boolean) and/or setFullname(String) how to signal a create or an update operation.

Author:
Thorben Betten

Constructor Summary
MailFolderDescription()
          Initializes a new MailFolderDescription
 
Method Summary
 void addPermission(MailPermission permission)
          Adds a permission
 void addPermissions(java.util.Collection<? extends MailPermission> permissions)
          Adds a collection of permissions
 void addPermissions(MailPermission[] permissions)
          Adds an array of permissions
 boolean containsExists()
          Checks if existence status has been set
 boolean containsFullname()
          Checks if fullname has been set
 boolean containsName()
          Checks if name has been set
 boolean containsParentFullname()
          Checks if parent fullname has been set
 boolean containsPermissions()
          Checks if permissions have been set
 boolean containsSeparator()
          Checks if separator has been set
 boolean containsSubscribed()
          Checks if subscription status has been set
 boolean exists()
          Checks if this folder exists
 int getAccountId()
          Gets the account ID belonging to fullname.
 java.lang.String getFullname()
          Gets the fullname
 java.lang.String getName()
          Gets the name
 int getParentAccountId()
          Gets the account ID belonging to parent.
 java.lang.String getParentFullname()
          Gets the parent fullname
 MailPermission[] getPermissions()
          Gets the permissions
 char getSeparator()
          Gets the separator
 boolean isSubscribed()
          Gets the subscription status
 void removeExists()
          Removes exists status
 void removeFullname()
          Removes the fullname
 void removeName()
          Removes the name
 void removeParentFullname()
          Removes the parent fullname
 void removePermissions()
          Removes the permissions
 void removeSeparator()
          Removes the separator
 void removeSubscribed()
          Removes the subscription status
 void setAccountId(int accountId)
          Sets the account ID belonging to fullname.
 void setExists(boolean exists)
          Sets the exists status This flag is checked at first to detect if an update or create operation shall be performed.
 void setFullname(java.lang.String fullname)
          Sets the fullname If containsExists() returns false the MailFolderStorage.exists(String) method is used to determine folder existence.
 void setName(java.lang.String name)
          Sets the name
 void setParentAccountId(int parentAccountId)
          Sets the account ID belonging to parent.
 void setParentFullname(java.lang.String parentFullname)
          Sets the parent fullname
 void setSeparator(char separator)
          Sets the separator
 void setSubscribed(boolean subscribed)
          Sets the subscription status
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailFolderDescription

public MailFolderDescription()
Initializes a new MailFolderDescription

Method Detail

addPermission

public void addPermission(MailPermission permission)
Adds a permission

Parameters:
permission - The permission to add

addPermissions

public void addPermissions(MailPermission[] permissions)
Adds an array of permissions

Parameters:
permissions - The array of permissions to add

addPermissions

public void addPermissions(java.util.Collection<? extends MailPermission> permissions)
Adds a collection of permissions

Parameters:
permissions - The collection of permissions to add

containsExists

public boolean containsExists()
Checks if existence status has been set

Returns:
true if exists status is set; otherwise false

containsFullname

public boolean containsFullname()
Checks if fullname has been set

Returns:
true if fullname is set; otherwise false

containsName

public boolean containsName()
Checks if name has been set

Returns:
true if name is set; otherwise false

containsParentFullname

public boolean containsParentFullname()
Checks if parent fullname has been set

Returns:
true if parentFullname is set; otherwise false

containsPermissions

public boolean containsPermissions()
Checks if permissions have been set

Returns:
true if permissions are set; otherwise false

containsSeparator

public boolean containsSeparator()
Checks if separator has been set

Returns:
true if separator is set; otherwise false

containsSubscribed

public boolean containsSubscribed()
Checks if subscription status has been set

Returns:
true if subscribed is set; otherwise false

exists

public boolean exists()
Checks if this folder exists

Returns:
true if folder exists in mailbox; otherwise false
See Also:
setExists(boolean)

getFullname

public java.lang.String getFullname()
Gets the fullname

Returns:
the fullname
See Also:
setFullname(String)

getAccountId

public int getAccountId()
Gets the account ID belonging to fullname.

Returns:
The account ID belonging to fullname.

getName

public java.lang.String getName()
Gets the name

Returns:
the name

getParentFullname

public java.lang.String getParentFullname()
Gets the parent fullname

Returns:
the parent fullname

getParentAccountId

public int getParentAccountId()
Gets the account ID belonging to parent.

Returns:
The account ID belonging to parent.

getPermissions

public MailPermission[] getPermissions()
Gets the permissions

Returns:
the permissions as array of MailPermission

getSeparator

public char getSeparator()
Gets the separator

Returns:
the separator

isSubscribed

public boolean isSubscribed()
Gets the subscription status

Returns:
the subscription status

removeExists

public void removeExists()
Removes exists status


removeFullname

public void removeFullname()
Removes the fullname


removeName

public void removeName()
Removes the name


removeParentFullname

public void removeParentFullname()
Removes the parent fullname


removePermissions

public void removePermissions()
Removes the permissions


removeSeparator

public void removeSeparator()
Removes the separator


removeSubscribed

public void removeSubscribed()
Removes the subscription status


setExists

public void setExists(boolean exists)
Sets the exists status

This flag is checked at first to detect if an update or create operation shall be performed. If not set - this is containsExists() returns false - the folder's fullname in conjunction with MailFolderStorage.exists(String) is used to determine folder existence.

Parameters:
exists - true if folder exists in mailbox; otherwise false
See Also:
setFullname(String)

setFullname

public void setFullname(java.lang.String fullname)
Sets the fullname

If containsExists() returns false the MailFolderStorage.exists(String) method is used to determine folder existence.

Parameters:
fullname - the fullname to set
See Also:
setExists(boolean)

setAccountId

public void setAccountId(int accountId)
Sets the account ID belonging to fullname.

Parameters:
accountId - The account ID

setName

public void setName(java.lang.String name)
Sets the name

Parameters:
name - the name to set

setParentFullname

public void setParentFullname(java.lang.String parentFullname)
Sets the parent fullname

Parameters:
parentFullname - the parent fullname to set

setParentAccountId

public void setParentAccountId(int parentAccountId)
Sets the account ID belonging to parent.

Parameters:
parentAccountId - The account ID belonging to parent.

setSeparator

public void setSeparator(char separator)
Sets the separator

Parameters:
separator - the separator to set

setSubscribed

public void setSubscribed(boolean subscribed)
Sets the subscription status

Parameters:
subscribed - the subscription status to set