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

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

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

The coordinates to identify an application.

See Also:
Serialized Form

Field Summary
static ApplicationId ANY_APP
          Defines the application for any group, name and version.
 
Constructor Summary
ApplicationId(String groupId, String artifactId, String version)
          Default constructor.
 
Method Summary
 int compareTo(ApplicationId o)
          
 boolean equals(Object object)
          Returns true if the given object is semantically equal to the given object, false otherwise.
 String getArtifactId()
          Returns the name of the application.
 String getGroupId()
          Returns the group the application belongs to.
 String getVersion()
          Returns the version of the application.
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_APP

public static final ApplicationId ANY_APP
Defines the application for any group, name and version.

Constructor Detail

ApplicationId

public ApplicationId(String groupId,
                     String artifactId,
                     String version)
              throws IllegalArgumentException
Default constructor.

Parameters:
groupId - the group the application belongs to. May be null
artifactId - the name of the application. May be null.
version - the version of the application. May be null.
Throws:
IllegalArgumentException - if either parameter is the empty string or contains only white spaces.
Method Detail

getGroupId

public String getGroupId()
Returns the group the application belongs to.

Returns:
the group the application belongs to. May be null.

getArtifactId

public String getArtifactId()
Returns the name of the application.

Returns:
the name of the application. May be null.

getVersion

public String getVersion()
Returns the version of the application.

Returns:
the version of the application. May be null.

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

Specified by:
compareTo in interface Comparable<ApplicationId>
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. The GAV elements are separated by a colon. If any element is null, the empty string is appended. If no element is specified, the returned string is ::.

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


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