Class Binding<V,B extends Binding<V,B>>
- Type Parameters:
V- the type of aBinding's value and of its attribute valuesB- the type of the subclass
- All Implemented Interfaces:
Comparable<B>,Constable
- Direct Known Subclasses:
Qualifier
- Author:
- Laird Nelson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns anintrepresenting a comparison of thisBindingwith the suppliedBinding, by considering the names, values and attributes of bothBindings.Optional<? extends ConstantDesc>Returns anOptionalhousing aConstantDescdescribing thisBinding, if thisBindingis capable of being represented as a dynamic constant, or an emptyOptionalif not.protected MethodHandleDescReturns aMethodHandleDescdescribing the constructor orstaticmethod that will be used to create a dynamic constant representing thisBinding.booleaninthashCode()info()final Stringname()Returns the name of thisBinding.toString()final Vvalue()Returns the value of thisBinding, which may benull.
-
Constructor Details
-
Binding
protected Binding(String name, V value, Map<? extends String, ?> attributes, Map<? extends String, ?> info) Creates a newBinding.- Parameters:
name- the name; must not benullvalue- the value; may benullattributes- further describing thisBinding; may benullinfo- informational attributes further describing thisBindingthat are not considered by itsequals(Object)implementation; may benull- See Also:
-
-
Method Details
-
name
Returns the name of thisBinding.- Returns:
- the name of this
Binding - Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
value
Returns the value of thisBinding, which may benull.- Returns:
- the value of this
Binding - Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method may return
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
attributes
Returns an immutableSortedMaprepresenting any attributes further describing thisBinding.The attributes are considered by the
equals(Object)method.- Returns:
- the attributes of this
Binding - Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
info
Returns an immutableSortedMaprepresenting any informational-only attributes further describing thisBinding.The attributes are not considered by the
equals(Object)method.- Returns:
- the informational attributes of this
Binding - Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
describeConstable
Returns anOptionalhousing aConstantDescdescribing thisBinding, if thisBindingis capable of being represented as a dynamic constant, or an emptyOptionalif not.- Specified by:
describeConstablein interfaceConstable- Returns:
- an
Optionalhousing aConstantDescdescribing thisBinding, if thisBindingis capable of being represented as a dynamic constant, or an emptyOptionalif not - See Also:
- Idempotency:
- This method is idempotent and deterministic.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
describeConstructor
Returns aMethodHandleDescdescribing the constructor orstaticmethod that will be used to create a dynamic constant representing thisBinding.- Returns:
- a
MethodHandleDescdescribing the constructor orstaticmethod that will be used to create a dynamic constant representing thisBinding - Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Nullability:
- This method does not, and its overrides must not, return
null. - Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
-
hashCode
Returns a hashcode for thisBindingthat represents its name, value and attributes.A subclass that overrides this method must also override the
equals(Object)andcompareTo(Binding)methods accordingly. -
compareTo
Returns anintrepresenting a comparison of thisBindingwith the suppliedBinding, by considering the names, values and attributes of bothBindings.Any attribute values that are not
Comparableinstances will be compared based on their string representations. It is strongly recommended that attribute values implementComparable.This method is, and its overrides must be, consistent with equals.
A subclass that overrides this method must also override the
hashCode()andequals(Object)methods accordingly.- Specified by:
compareToin interfaceComparable<V>- Parameters:
other- the otherBinding; may benullin which case a negative value will be returned- Returns:
- an
intrepresenting a comparison of thisBindingwith the suppliedBinding - See Also:
- Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
-
equals
Returnstrueif the suppliedObjectis equal to thisBinding.The supplied
Objectis considered to be equal to thisBindingif and only if:- Its class is identical to this
Binding's class, and - Its name is equal to this
Binding's name, and - Its value is equal to this
Binding's value, and - Its attributes are equal to this
Binding's attributes
A subclass that overrides this method must also override the
hashCode()andcompareTo(Binding)methods accordingly.- Overrides:
equalsin classObject- Parameters:
other- theObjectto test; may benullin which casefalsewill be returned- Returns:
trueif the suppliedObjectis equal to thisBinding- See Also:
- Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
- Its class is identical to this
-
toString
Returns aStringrepresentation of thisBinding.The format of the returned
Stringis deliberately undefined and may change between versions of this class without prior notice.- Overrides:
toStringin classObject- Returns:
- a
Stringrepresentation of thisBinding - Idempotency:
- This method is, and its overrides must be, idempotent and deterministic.
- Nullability:
- This method does not, and its overrides must not, return
null. - Thread Safety:
- This method is, and its overrides must be, safe for concurrent use by multiple threads.
-