de.smartics.properties.impl.config.domain.key.envapp
Class AbstractConfigurationKey<T extends AbstractConfigurationKey<T>>

Package class diagram package AbstractConfigurationKey
java.lang.Object
  extended by de.smartics.properties.impl.config.domain.key.envapp.AbstractConfigurationKey<T>
Type Parameters:
T - the type of the configuration key.
All Implemented Interfaces:
ConfigurationKey<T>, Serializable, Comparable<T>
Direct Known Subclasses:
EnvAppConfigurationKey, TenantUserConfigurationKey

public abstract class AbstractConfigurationKey<T extends AbstractConfigurationKey<T>>
     
     
extends Object
implements Serializable, ConfigurationKey<T>

Abstract base implementation to be extended by subclasses that want to add additional key components to environment and application.

See Also:
Serialized Form

Field Summary
protected  int hashCodeValue
          The pre-calculated hash code of this instance.
 
Constructor Summary
protected AbstractConfigurationKey(EnvironmentId environmentId, ApplicationId applicationId)
          Default constructor.
protected AbstractConfigurationKey(T key, ApplicationId appId)
          Copy constructor.
 
Method Summary
 int compareTo(T o)
           
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 ApplicationId getApplicationId()
          Returns the identifier of the application whose configuration is requested.
 EnvironmentId getEnvironmentId()
          Returns the identifier of the environment the application is deployed in.
 boolean hasActiveDynamicParts()
          Returns true if this key instance has active dynamic parts.
 int hashCode()
          Returns the hash code of the object.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

hashCodeValue

protected final int hashCodeValue
The pre-calculated hash code of this instance.

Constructor Detail

AbstractConfigurationKey

protected AbstractConfigurationKey(EnvironmentId environmentId,
                                   ApplicationId applicationId)
                            throws NullPointerException
Default constructor.

Parameters:
applicationId - the identifier of the application whose configuration is requested.
environmentId - the identifier of the environment the application is deployed in.
Throws:
NullPointerException - if applicationId or environmentId is null.

AbstractConfigurationKey

protected AbstractConfigurationKey(T key,
                                   ApplicationId appId)
                            throws NullPointerException
Copy constructor.

Parameters:
key - the key to copy.
appId - the appId to set into the copy.
Throws:
NullPointerException - if key or appId is null.
Method Detail

getEnvironmentId

public final EnvironmentId getEnvironmentId()
Returns the identifier of the environment the application is deployed in.

Returns:
the identifier of the environment the application is deployed in.

getApplicationId

public final ApplicationId getApplicationId()
Returns the identifier of the application whose configuration is requested.

Returns:
the identifier of the application whose configuration is requested.

hasActiveDynamicParts

public boolean hasActiveDynamicParts()
Description copied from interface: ConfigurationKey
Returns true if this key instance has active dynamic parts. Returns false (otherwise) if this key instance has only static parts. The decision criteria between a static and a dynamic key is, if all keys are known at startup, or if keys have dynamic parts, like the current user or the current tenant which can change during runtime.

Specified by:
hasActiveDynamicParts in interface ConfigurationKey<T extends AbstractConfigurationKey<T>>
Returns:
true when this key uses dynamic parts (and not only static parts). false otherwise.

hashCode

public int hashCode()
Returns the hash code of the object.

Specified by:
hashCode in interface ConfigurationKey<T extends AbstractConfigurationKey<T>>
Overrides:
hashCode in class Object
Returns:
the hash code.

equals

public boolean equals(Object object)
Returns true if the given object is semantically equal to the given object, false otherwise.

Specified by:
equals in interface ConfigurationKey<T extends AbstractConfigurationKey<T>>
Overrides:
equals in class Object
Parameters:
object - the instance to compare to.
Returns:
true if the given object is semantically equal to the given object, false otherwise.

compareTo

public int compareTo(T o)
Specified by:
compareTo in interface ConfigurationKey<T extends AbstractConfigurationKey<T>>
Specified by:
compareTo in interface Comparable<T extends AbstractConfigurationKey<T>>

toString

public String toString()
Returns the string representation of the object.

Specified by:
toString in interface ConfigurationKey<T extends AbstractConfigurationKey<T>>
Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.