com.stratelia.webactiv
Enum SilverpeasRole

java.lang.Object
  extended by java.lang.Enum<SilverpeasRole>
      extended by com.stratelia.webactiv.SilverpeasRole
All Implemented Interfaces:
Serializable, Comparable<SilverpeasRole>

public enum SilverpeasRole
extends Enum<SilverpeasRole>


Enum Constant Summary
admin
           
Manager
           
privilegedUser
           
publisher
           
reader
           
supervisor
           
user
           
writer
           
 
Field Summary
static EnumSet<SilverpeasRole> READER_ROLES
           
 
Method Summary
static String asString(Set<SilverpeasRole> roles)
          Gets on or several roles as a string.
static boolean exists(String name)
           
static SilverpeasRole from(String name)
           
static Set<SilverpeasRole> from(String[] roles)
           
static SilverpeasRole getGreaterFrom(Collection<SilverpeasRole> roles)
          Deprecated. use instead getGreatestFrom(Collection)
static SilverpeasRole getGreaterFrom(SilverpeasRole... roles)
          Deprecated. use instead getGreatestFrom(SilverpeasRole...)
static SilverpeasRole getGreatestFrom(Collection<SilverpeasRole> roles)
          Gets the greater role from the given ones.
static SilverpeasRole getGreatestFrom(SilverpeasRole... roles)
          Gets the greatest role from the given ones.
static SilverpeasRole getGreatestOfCurrentUserOn(String componentInstanceId)
          Gets the greatest role on the component represented by the given identifier the current user has.
 String getName()
           
 boolean isGreaterThan(SilverpeasRole role)
          Indicates if a role is greater than an other one.
 boolean isGreaterThanOrEquals(SilverpeasRole role)
          Indicates if a role is greater than or equals an other one.
 boolean isInRole(String... roles)
           
static Set<SilverpeasRole> listFrom(String roles)
          Lists the roles from a string.
static SilverpeasRole valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SilverpeasRole[] 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

admin

public static final SilverpeasRole admin

Manager

public static final SilverpeasRole Manager

publisher

public static final SilverpeasRole publisher

writer

public static final SilverpeasRole writer

privilegedUser

public static final SilverpeasRole privilegedUser

user

public static final SilverpeasRole user

reader

public static final SilverpeasRole reader

supervisor

public static final SilverpeasRole supervisor
Field Detail

READER_ROLES

public static EnumSet<SilverpeasRole> READER_ROLES
Method Detail

values

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

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

valueOf

public static SilverpeasRole valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getName

public String getName()

isGreaterThan

public boolean isGreaterThan(SilverpeasRole role)
Indicates if a role is greater than an other one.

Parameters:
role -
Returns:

isGreaterThanOrEquals

public boolean isGreaterThanOrEquals(SilverpeasRole role)
Indicates if a role is greater than or equals an other one.

Parameters:
role -
Returns:

from

public static SilverpeasRole from(String name)

exists

public static boolean exists(String name)

listFrom

public static Set<SilverpeasRole> listFrom(String roles)
Lists the roles from a string. (Each one separated by a comma)

Parameters:
roles -
Returns:

from

public static Set<SilverpeasRole> from(String[] roles)

isInRole

public boolean isInRole(String... roles)

asString

public static String asString(Set<SilverpeasRole> roles)
Gets on or several roles as a string. They are separated between them by comma.

Parameters:
roles -
Returns:

getGreaterFrom

public static SilverpeasRole getGreaterFrom(SilverpeasRole... roles)
Deprecated. use instead getGreatestFrom(SilverpeasRole...)


getGreatestFrom

public static SilverpeasRole getGreatestFrom(SilverpeasRole... roles)
Gets the greatest role from the given ones.

Parameters:
roles -
Returns:

getGreaterFrom

public static SilverpeasRole getGreaterFrom(Collection<SilverpeasRole> roles)
Deprecated. use instead getGreatestFrom(Collection)


getGreatestFrom

public static SilverpeasRole getGreatestFrom(Collection<SilverpeasRole> roles)
Gets the greater role from the given ones.

Parameters:
roles -
Returns:

getGreatestOfCurrentUserOn

public static SilverpeasRole getGreatestOfCurrentUserOn(String componentInstanceId)
Gets the greatest role on the component represented by the given identifier the current user has.

Parameters:
componentInstanceId - a component instance identifier.
Returns:
a SilverpeasRole instance or null if none.


Copyright © 2016 Silverpeas. All Rights Reserved.