de.smartics.properties.api.config.domain.key
Class EnvironmentId

Package class diagram package EnvironmentId
java.lang.Object
  extended by de.smartics.properties.api.config.domain.key.EnvironmentId
All Implemented Interfaces:
Serializable, Comparable< EnvironmentId>

public final class EnvironmentId
     
     
extends Object
implements Serializable, Comparable< EnvironmentId>

Defines an environment an application is deployed to.

See Also:
Serialized Form

Field Summary
static EnvironmentId ANY_ENV
          Defines the application for any environment.
 
Constructor Summary
EnvironmentId(String name)
          Convenience constructor without a node.
EnvironmentId(String name, String node)
          Default constructor.
 
Method Summary
 int compareTo(EnvironmentId o)
          
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 String getName()
          Returns the name of the environment.
 String getNode()
          Returns the optional identifier of the node within the given environment.
 int hashCode()
          Returns the hash code of the object.
 String toPath()
          Returns the string representation of the object as a path.
 String toString()
          Returns the string representation of the object.
static EnvironmentId valueOf(String environmentString)
          Returns an EnvironmentId for the given String or throws an IllegalArgumentException if the String is not valid.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_ENV

public static final EnvironmentId ANY_ENV
Defines the application for any environment.

Constructor Detail

EnvironmentId

public EnvironmentId(String name)
              throws IllegalArgumentException
Convenience constructor without a node.

Parameters:
name - the name of the environment.
Throws:
IllegalArgumentException - if name is the empty string or contains only white spaces.

EnvironmentId

public EnvironmentId(String name,
                     String node)
              throws IllegalArgumentException
Default constructor.

Parameters:
name - the name of the environment.
node - the optional identifier of the node within the given environment.
Throws:
IllegalArgumentException - if name or node is the empty string or contains only white spaces.
Method Detail

getName

public String getName()
Returns the name of the environment.

Returns:
the name of the environment.

getNode

public String getNode()
Returns the optional identifier of the node within the given environment.

Returns:
the optional identifier of the node within the given environment.

hashCode

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

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.

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(EnvironmentId o)

Specified by:
compareTo in interface Comparable<EnvironmentId>
See Also:
Comparable.compareTo(java.lang.Object)

toPath

public String toPath()
Returns the string representation of the object as a path. All elements are separated by a slash.

Returns:
the string representation of the object.

toString

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

Overrides:
toString in class Object
Returns:
the string representation of the object.

valueOf

public static EnvironmentId valueOf(String environmentString)
                             throws IllegalArgumentException
Returns an EnvironmentId for the given String or throws an IllegalArgumentException if the String is not valid.

Parameters:
environmentString - a string describing an environment.
Returns:
an envrironmentId for the given String.
Throws:
IllegalArgumentException - if an invalid environmentString has been passed.


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