Package org.togglz.core.user
Class SimpleFeatureUser
- java.lang.Object
-
- org.togglz.core.user.SimpleFeatureUser
-
- All Implemented Interfaces:
FeatureUser
public class SimpleFeatureUser extends Object implements FeatureUser
Default implementation ofFeatureUser.- Author:
- Christian Kaltepoth
-
-
Constructor Summary
Constructors Constructor Description SimpleFeatureUser(String name)Constructor ofDefaultFeatureManager.SimpleFeatureUser(String name, boolean featureAdmin)Constructor ofDefaultFeatureManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)This method allows to retrieve attributes associated with a user.StringgetName()Get the unique name for this usebooleanisFeatureAdmin()Is the user a feature admin, which means that he is able to use the Togglz Admin Console.SimpleFeatureUsersetAttribute(String name, Object value)This method can be used to set attributes of the user.
-
-
-
Constructor Detail
-
SimpleFeatureUser
public SimpleFeatureUser(String name)
- Parameters:
name- The name of the user
-
SimpleFeatureUser
public SimpleFeatureUser(String name, boolean featureAdmin)
Constructor ofDefaultFeatureManager.- Parameters:
name- The name of the userfeatureAdmin-trueif the user is a feature admin
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:FeatureUserGet the unique name for this use- Specified by:
getNamein interfaceFeatureUser- Returns:
- name of the user
-
isFeatureAdmin
public boolean isFeatureAdmin()
Description copied from interface:FeatureUserIs the user a feature admin, which means that he is able to use the Togglz Admin Console.- Specified by:
isFeatureAdminin interfaceFeatureUser- Returns:
truefor feature admins,falseotherwise.
-
getAttribute
public Object getAttribute(String name)
Description copied from interface:FeatureUserThis method allows to retrieve attributes associated with a user.- Specified by:
getAttributein interfaceFeatureUser- Parameters:
name- The name of the attribute- Returns:
- the value of the attribute or
nullif there is no such attribute.
-
setAttribute
public SimpleFeatureUser setAttribute(String name, Object value)
This method can be used to set attributes of the user.- Parameters:
name- The name of the attributevalue- The value of the attribute- Returns:
thisfor fluent object creation
-
-