java.lang.Object
java.lang.Record
org.microbean.qualifier.Qualified.Record<V,T>
- Type Parameters:
V
- the type borne by the values of theQualifiers
in thisQualified.Record
T
- the type of the object that is qualified; note that if it does not extendConstable
then aQualified.Record
bearing it will return an emptyOptional
from itsdescribeConstable()
method- Record Components:
qualifiers
- theQualifiers
; may benull
in which case the return value ofQualifiers.of()
will be used insteadqualified
- the object being qualified; may benull
public static record Qualified.Record<V,T> (Qualifiers<V> qualifiers, T qualified)
extends Record
implements Qualified<V,T>, Constable
- Author:
- Laird Nelson
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.microbean.qualifier.Qualified
Qualified.Record<V,
T> -
Constructor Summary
ConstructorDescriptionRecord
(Qualifiers<V> qualifiers, T qualified) Creates a newQualified.Record
.Creates a newQualified.Record
. -
Method Summary
Modifier and TypeMethodDescriptionfinal Optional<? extends ConstantDesc>
Returns anOptional
housing aConstantDesc
describing thisQualified.Record
, if thisQualified.Record
is capable of being represented as a dynamic constant, or an emptyOptional
if not.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static final <V,
T> Qualified.Record<V, T> of
(Qualifiers<V> qualifiers, T qualified) Returns aQualified.Record
, which may or may not be newly created, representing the suppliedQualifiers
and qualified object.static final <V,
T> Qualified.Record<V, T> of
(T qualified) Returns aQualified.Record
, which may or may not be newly created, representing the qualified object.Returns the value of thequalified
record component.Returns the value of thequalifiers
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Record
Creates a newQualified.Record
.- Parameters:
qualified
- the object being qualified; may benull
- See Also:
-
Record
Creates a newQualified.Record
.- Parameters:
qualifiers
- theQualifiers
; may benull
in which case the return value ofQualifiers.of()
will be used insteadqualified
- the object being qualified; may benull
-
-
Method Details
-
describeConstable
Returns anOptional
housing aConstantDesc
describing thisQualified.Record
, if thisQualified.Record
is capable of being represented as a dynamic constant, or an emptyOptional
if not.- Specified by:
describeConstable
in interfaceConstable
- Specified by:
describeConstable
in interfaceQualified<V,
T> - Returns:
- an
Optional
housing aConstantDesc
describing thisQualified.Record
, if thisQualified.Record
is capable of being represented as a dynamic constant, or an emptyOptional
if not - See Also:
- 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.
-
of
Returns aQualified.Record
, which may or may not be newly created, representing the qualified object.- Type Parameters:
V
- the type of theQualified.Record
'sQualifiers
' value and attribute valuesT
- the type of the qualified object- Parameters:
qualified
- the qualified object; may benull
- Returns:
- a
Qualified.Record
- See Also:
- Idempotency:
- This method is neither idempotent nor deterministic.
- Nullability:
- This method never returns
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
of
Returns aQualified.Record
, which may or may not be newly created, representing the suppliedQualifiers
and qualified object.- Type Parameters:
V
- the type of theQualified.Record
'sQualifiers
' value and attribute valuesT
- the type of the qualified object- Parameters:
qualifiers
- theQualifiers
; may benull
qualified
- the qualified object; may benull
- Returns:
- a
Qualified.Record
- Idempotency:
- This method is neither idempotent nor deterministic.
- Nullability:
- This method never returns
null
. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
qualifiers
Returns the value of thequalifiers
record component.- Specified by:
qualifiers
in interfaceQualified<V,
T> - Returns:
- the value of the
qualifiers
record component
-
qualified
Returns the value of thequalified
record component.
-