Record Class AnnotationValueRecord
java.lang.Object
java.lang.Record
org.microbean.construct.element.AnnotationValueRecord
- Record Components:
delegate
- anAnnotationValue
to which operations will be delegated; must not benull
domain
- aDomain
; must not benull
- All Implemented Interfaces:
AnnotationValue
public record AnnotationValueRecord(AnnotationValue delegate, Domain domain)
extends Record
implements AnnotationValue
An
AnnotationValue
implementation.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorDescriptionAnnotationValueRecord
(AnnotationValue delegate, Domain domain) Creates a newAnnotationValueRecord
. -
Method Summary
Modifier and TypeMethodDescriptionfinal <R,
P> R accept
(AnnotationValueVisitor<R, P> v, P p) delegate()
Returns the value of thedelegate
record component.domain()
Returns the value of thedomain
record component.final boolean
Indicates whether some other object is "equal to" this one.final Object
getValue()
final int
hashCode()
Returns a hash code value for this object.static final List
<? extends AnnotationValueRecord> of
(Collection<? extends AnnotationValue> avs, Domain domain) Returns a non-null
, immutableList
ofAnnotationValueRecord
s whose elements wrap the suppliedList
's elements.static final AnnotationValueRecord
of
(AnnotationValue av, Domain domain) Returns a non-null
AnnotationValueRecord
that is either the suppliedAnnotationValue
(if it itself isnull
or is anAnnotationValueRecord
) or one that wraps it.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AnnotationValueRecord
Creates a newAnnotationValueRecord
.- Parameters:
delegate
- anAnnotationValue
to which operations will be delegated; must not benull
domain
- aDomain
; must not benull
- Throws:
NullPointerException
- if either argument isnull
-
-
Method Details
-
accept
- Specified by:
accept
in interfaceAnnotationValue
-
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)
. -
getValue
- Specified by:
getValue
in interfaceAnnotationValue
-
hashCode
-
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.- Specified by:
toString
in interfaceAnnotationValue
- Specified by:
toString
in classRecord
- Returns:
- a string representation of this object
-
of
Returns a non-null
AnnotationValueRecord
that is either the suppliedAnnotationValue
(if it itself isnull
or is anAnnotationValueRecord
) or one that wraps it.- Parameters:
av
- anAnnotationValue
; may benull
domain
- aDomain
; must not benull
- Returns:
- an
AnnotationValueRecord
, ornull
(ifav
isnull
) - Throws:
NullPointerException
- ifdomain
isnull
- See Also:
-
of
public static final List<? extends AnnotationValueRecord> of(Collection<? extends AnnotationValue> avs, Domain domain) Returns a non-null
, immutableList
ofAnnotationValueRecord
s whose elements wrap the suppliedList
's elements.- Parameters:
avs
- aCollection
ofAnnotationValue
s; must not benull
domain
- aDomain
; must not benull
- Returns:
- a non-
null
, immutableList
ofAnnotationValueRecord
s - Throws:
NullPointerException
- if either argument isnull
-
delegate
-
domain
-