All Packages Class Hierarchy This Package Previous Next Index
Class uhr.core.attract.AttributeStd
java.lang.Object
|
+----uhr.core.attract.AttributeStd
- public class AttributeStd
- extends Object
- implements Attribute
An Attribute describes a single behavior characteristic of a
service. A collection of Attributes describes the behavior of
a service offering or need. The advantage to using Attributes
is they allow an easy service offering and need matching
mechanism. Thus Attributes lie at the heart of the Attractor
Pattern used to match host services to client service needs.
An Attribute is immutable.
-
AttributeStd(String,
Object)
- Creates a new immutable Attribute.
-
equals(Object)
- Overrides the method in Object for use in matching.
-
getName()
- Returns the attribute name.
-
getValue()
- Returns the attribute value.
-
toString()
- Overrides the method in Object for use in debugging and such.
AttributeStd
public AttributeStd(String name,
Object value)
- Creates a new immutable Attribute.
- Parameters:
- name - the name, which cannot be null since the name is
the Attribute identifier.
- value - the value, which cannot be null.
- Throws: IllegalArgumentException
- if either argument is null.
equals
public boolean equals(Object object)
- Overrides the method in Object for use in matching.
- Parameters:
- object - the object to compare to.
- Returns:
- true if equal or false if not.
- Overrides:
- equals in class Object
toString
public String toString()
- Overrides the method in Object for use in debugging and such.
- Returns:
- the string representation, which is the name and value.
- Overrides:
- toString in class Object
getName
public String getName()
- Returns the attribute name. This is semantically descriptive but
is really just a unique id per attractor. The name is never null.
- Returns:
- the attribute name.
getValue
public Object getValue()
- Returns the attribute value. If the value equals() the value in
another attribute with the same name, the attributes match.
A value equalivent to "all" matches all other values.
The value may not be null, because nulls introduce too much
complexity and null is not necessary.
- Returns:
- the attribute value, which is never null.
All Packages Class Hierarchy This Package Previous Next Index