org.openwms.core.domain.system.usermanagement
Class RolePreference

java.lang.Object
  extended by org.openwms.core.domain.AbstractEntity
      extended by org.openwms.core.domain.system.AbstractPreference
          extended by org.openwms.core.domain.system.usermanagement.RolePreference
All Implemented Interfaces:
Serializable, DomainObject<Long>

public class RolePreference
extends AbstractPreference

A RolePreference is used to provide settings specific to an Role . These kind of Preferences is valid for the assigned Role only. Users assigned to a Role inherit these RolePreferences but a RolePreference can be overruled by an UserPreference. RolePreferences can be defined within a preferences file but also be created with the UI.

Since:
0.1
Version:
$Revision: $
Author:
Heiko Scherrer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openwms.core.domain.AbstractEntity
AbstractEntity.AbstractEntityListener
 
Field Summary
static String NQ_FIND_ALL
          Query to find all RolePreferences.
 
Fields inherited from class org.openwms.core.domain.AbstractEntity
FIND_ALL, FIND_BY_ID
 
Constructor Summary
RolePreference(String rolename, String key)
          Create a new RolePreference.
 
Method Summary
 boolean equals(Object obj)
           Compare the uid property field.
protected  Object[] getFields()
          Return all fields as an array of objects.
 String getKey()
          Get the key.
 String getOwner()
          Get the name of the Role as String.
 PreferenceKey getPrefKey()
          Return a PreferenceKey of this preference.
 PropertyScope getType()
          Return the particular type of the preference.
 int hashCode()
           Use the uid to calculate the hashCode.
 
Methods inherited from class org.openwms.core.domain.system.AbstractPreference
getDescription, getFloatValue, getId, getMaximum, getMinimum, getPropertiesAsString, getValue, getVersion, isFromFile, isNew, setDescription, setFloatValue, setFromFile, setMaximum, setMinimum, setValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NQ_FIND_ALL

public static final String NQ_FIND_ALL
Query to find all RolePreferences. Name is "RolePreference.findAll" .

See Also:
Constant Field Values
Constructor Detail

RolePreference

public RolePreference(String rolename,
                      String key)
Create a new RolePreference.

Parameters:
rolename - The name of the Role that owns this preference
key - the key
Throws:
IllegalArgumentException - when rolename or key is null or empty
Method Detail

getKey

public String getKey()
Get the key.

Returns:
the key.

getOwner

public String getOwner()
Get the name of the Role as String.

Returns:
the rolename.

getType

public PropertyScope getType()
Return the particular type of the preference.

Specified by:
getType in class AbstractPreference
Returns:
The type of the preference
See Also:
AbstractPreference.getType()

getFields

protected Object[] getFields()
Return all fields as an array of objects.

Specified by:
getFields in class AbstractPreference
Returns:
fields as array
See Also:
AbstractPreference.getFields()

getPrefKey

public PreferenceKey getPrefKey()
Return a PreferenceKey of this preference. Uses the type, owner and the key to create a PreferenceKey instance.

Specified by:
getPrefKey in class AbstractPreference
Returns:
A PreferenceKey
See Also:
AbstractPreference.getPrefKey()

hashCode

public int hashCode()
Use the uid to calculate the hashCode.

Use all fields to calculate the hashCode and don't use the hashCode of the super class.

Uses key, owner and type for hashCode calculation.

Overrides:
hashCode in class AbstractPreference
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Compare the uid property field.

Use all fields for comparison but don't call the super class.

Comparison done with key, owner and type fields. Not delegated to super class.

Overrides:
equals in class AbstractPreference
See Also:
Object.equals(java.lang.Object)


Copyright © 2005-2011 openwms.org. All Rights Reserved.