Class RolePreference
java.lang.Object
org.openwms.core.preferences.impl.file.AbstractPreference
org.openwms.core.preferences.impl.file.GenericPreference
org.openwms.core.preferences.impl.file.RolePreference
- All Implemented Interfaces:
Serializable
A RolePreference is used to provide settings specific to an
Role
. These kind of Preferences
is valid for the assigned
Role only. User
s 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.- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
Key value of theRolePreference
.private String
Owner of theRolePreference
.Fields inherited from class org.openwms.core.preferences.impl.file.GenericPreference
description, maximum, minimum, type, value
-
Constructor Summary
ConstructorDescriptionCreate a new RolePreference.RolePreference
(String rolename, String key) Create a new RolePreference. -
Method Summary
Methods inherited from class org.openwms.core.preferences.impl.file.GenericPreference
getDescription, getMaximum, getMinimum, getType, getValue, setDescription, setMaximum, setMinimum, setType, setValue
-
Field Details
-
owner
Owner of theRolePreference
. -
key
Key value of theRolePreference
.
-
-
Constructor Details
-
RolePreference
public RolePreference()Create a new RolePreference. Defined for the JAXB implementation. -
RolePreference
Create a new RolePreference.- Parameters:
rolename
- The name of the Role that owns this preferencekey
- the key- Throws:
IllegalArgumentException
- when rolename or key is null or empty
-
-
Method Details
-
getKey
Get the key.- Returns:
- the key.
-
setKey
-
getOwner
Get the name of theRole
as String.- Returns:
- the rolename.
-
setOwner
-
getFields
Return all fields as an array of objects.- Specified by:
getFields
in classAbstractPreference
- Returns:
- fields as array
- See Also:
-
getPrefKey
Return aPreferenceKey
of this preference.Uses the type, owner and the key to create a
PreferenceKey
instance.- Specified by:
getPrefKey
in classAbstractPreference
- Returns:
- A
PreferenceKey
- See Also:
-
hashCode
public int hashCode()Uses key, owner and type for hashCode calculation.
- Overrides:
hashCode
in classGenericPreference
- See Also:
-
equals
Comparison done with key, owner and type fields. Not delegated to super class.
- Overrides:
equals
in classGenericPreference
- See Also:
-
toString
Use all fields.
- Overrides:
toString
in classGenericPreference
-