de.smartics.properties.api.config.domain
Class PropertyLocation

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

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

Identifies the location of a property.

See Also:
Serialized Form

Constructor Summary
PropertyLocation(ApplicationId applicationId, String path)
          Default constructor.
PropertyLocation(String path)
          Convenience constructor if no application identifier is available.
 
Method Summary
 int compareTo(PropertyLocation 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 archive that contains the property.
 String getPath()
          Returns the identifier of the property location within the application.
 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
 

Constructor Detail

PropertyLocation

public PropertyLocation(String path)
                 throws IllegalArgumentException
Convenience constructor if no application identifier is available.

Parameters:
path - the identifier of the property location within the application.
Throws:
IllegalArgumentException - if path is null.

PropertyLocation

public PropertyLocation(ApplicationId applicationId,
                        String path)
                 throws IllegalArgumentException
Default constructor.

Parameters:
applicationId - the identifier of the application archive that contains the property.
path - the identifier of the property location within the application.
Throws:
IllegalArgumentException - if path is null.
Method Detail

getApplicationId

@CheckForNull
public ApplicationId getApplicationId()
Returns the identifier of the application archive that contains the property. The value may be null if no archive contains the information. This is e.g. the case if the property is provided by a data source or other external information system.

Returns:
the identifier of the application archive that contains the property. May be null.

getPath

public String getPath()
Returns the identifier of the property location within the application. The path may serve as an ID like a JNDI name or name the path to a properties file within the archive.

This value must not be null.

Returns:
the identifier of the property location within the application.

compareTo

public int compareTo(PropertyLocation o)
Specified by:
compareTo in interface Comparable<PropertyLocation>

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.

toString

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

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


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