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

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

public class Property
     
     
extends Object
implements Serializable, Comparable< Property>

Stores information of a property.

See Also:
Serialized Form

Constructor Summary
protected Property(Property property)
          Copy-constructor.
  Property(PropertyLocation source, String name, Object value)
          Convenience constructor that translates the value to a String.
  Property(PropertyLocation source, String name, String value)
          Default constructor.
  Property(String source, String name, Object value)
          Convenience constructor that translates the value to a String.
 
Method Summary
 int compareTo(Property 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 property.
 PropertyLocation getSource()
          Returns the optional source where the property value has been defined.
 String getValue()
          Returns the value of the property.
 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

Property

public Property(PropertyLocation source,
                String name,
                String value)
         throws NullPointerException,
                IllegalArgumentException
Default constructor.

Parameters:
source - the optional source where the property value has been defined.
name - the name of the property.
value - the value of the property.
Throws:
NullPointerException - if source is null.
IllegalArgumentException - if name is blank.

Property

public Property(PropertyLocation source,
                String name,
                Object value)
         throws IllegalArgumentException
Convenience constructor that translates the value to a String.

Parameters:
source - the optional source where the property value has been defined.
name - the name of the property.
value - the value of the property.
Throws:
IllegalArgumentException - if name is blank.

Property

public Property(String source,
                String name,
                Object value)
         throws IllegalArgumentException
Convenience constructor that translates the value to a String.

Parameters:
source - the optional source where the property value has been defined.
name - the name of the property.
value - the value of the property.
Throws:
IllegalArgumentException - if name is blank.

Property

protected Property(Property property)
Copy-constructor.

Parameters:
property - the property to copy.
Method Detail

getSource

public final PropertyLocation getSource()
Returns the optional source where the property value has been defined. This is an arbitrary name that defines the origin in its context.

Returns:
the optional source where the property value has been defined.

getName

public final String getName()
Returns the name of the property. Must not blank.

Returns:
the name of the property.

getValue

public final String getValue()
Returns the value of the property. May be null.

Returns:
the value of the property.

compareTo

public final int compareTo(Property o)

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

hashCode

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

Overrides:
hashCode in class Object
Returns:
the hash code.

equals

public final 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.