Class UserPreference
java.lang.Object
org.openwms.core.preferences.impl.file.AbstractPreference
org.openwms.core.preferences.impl.file.GenericPreference
org.openwms.core.preferences.impl.file.UserPreference
- All Implemented Interfaces:
Serializable
An UserPreference is used to store settings specific to an
User
. It is always assigned to a particular User
and
not accessible from, nor valid for, other User
s. UserPreferences cannot be overruled by any other type of
Preferences
.- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
Key value of theUserPreference
.private String
Owner of theUserPreference
.Fields inherited from class org.openwms.core.preferences.impl.file.GenericPreference
description, maximum, minimum, type, value
-
Constructor Summary
ConstructorDescriptionCreate a new UserPreference.UserPreference
(String owner, String key) Create a new UserPreference. -
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 theUserPreference
. -
key
Key value of theUserPreference
.
-
-
Constructor Details
-
UserPreference
public UserPreference()Create a new UserPreference. Defined for the JAXB implementation. -
UserPreference
Create a new UserPreference.- Parameters:
owner
- The User's username is set as owner of this preferencekey
- The key of this preference- Throws:
IllegalArgumentException
- when owner or key is null or empty
-
-
Method Details
-
getOwner
Get the owner.- Returns:
- the owner.
-
setOwner
-
getKey
Get the key.- Returns:
- the key.
-
setKey
-
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.- 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
-