org.openwms.core.domain.preferences
Class ApplicationPreference

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

public class ApplicationPreference
extends AbstractPreference

An ApplicationPreference is used to store a configuration setting in application scope.

The table model of an ApplicationPreference spans an unique key over the columns C_TYPE and C_KEY.

It's counterpart in the context of JAXB is the applicationPreference element.

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 ApplicationPreferences.
 
Fields inherited from class org.openwms.core.domain.AbstractEntity
FIND_ALL, FIND_BY_ID
 
Constructor Summary
ApplicationPreference()
          Create a new ApplicationPreference.
ApplicationPreference(String key)
          Create a new ApplicationPreference.
 
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.
 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 ApplicationPreferences. Name is "ApplicationPreference.findAll" .

See Also:
Constant Field Values
Constructor Detail

ApplicationPreference

public ApplicationPreference()
Create a new ApplicationPreference. Only defined by the JAXB implementation.


ApplicationPreference

public ApplicationPreference(String key)
Create a new ApplicationPreference.

Parameters:
key - the key
Throws:
IllegalArgumentException - when key is null or empty
Method Detail

getKey

public String getKey()
Get the key.

Returns:
the key

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 and 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 the type and the key for the 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 the type and the key 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.