Record Class AnnotationValueRecord
java.lang.Object
java.lang.Record
org.microbean.construct.element.AnnotationValueRecord
- Record Components:
delegate- anAnnotationValueto which operations will be delegated; must not benulldomain- 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
ConstructorsConstructorDescriptionAnnotationValueRecord(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 thedelegaterecord component.domain()Returns the value of thedomainrecord component.final booleanIndicates whether some other object is "equal to" this one.final ObjectgetValue()final inthashCode()Returns a hash code value for this object.static final List<? extends AnnotationValueRecord> of(Collection<? extends AnnotationValue> avs, Domain domain) Returns a non-null, immutableListofAnnotationValueRecords whose elements wrap the suppliedList's elements.static final AnnotationValueRecordof(AnnotationValue av, Domain domain) Returns a non-nullAnnotationValueRecordthat is either the suppliedAnnotationValue(if it itself isnullor is anAnnotationValueRecord) or one that wraps it.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AnnotationValueRecord
Creates a newAnnotationValueRecord.- Parameters:
delegate- anAnnotationValueto which operations will be delegated; must not benulldomain- aDomain; must not benull- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
accept
- Specified by:
acceptin 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:
getValuein 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:
toStringin interfaceAnnotationValue- Specified by:
toStringin classRecord- Returns:
- a string representation of this object
-
of
Returns a non-nullAnnotationValueRecordthat is either the suppliedAnnotationValue(if it itself isnullor is anAnnotationValueRecord) or one that wraps it.- Parameters:
av- anAnnotationValue; may benulldomain- aDomain; must not benull- Returns:
- an
AnnotationValueRecord, ornull(ifavisnull) - Throws:
NullPointerException- ifdomainisnull- See Also:
-
of
public static final List<? extends AnnotationValueRecord> of(Collection<? extends AnnotationValue> avs, Domain domain) Returns a non-null, immutableListofAnnotationValueRecords whose elements wrap the suppliedList's elements.- Parameters:
avs- aCollectionofAnnotationValues; must not benulldomain- aDomain; must not benull- Returns:
- a non-
null, immutableListofAnnotationValueRecords - Throws:
NullPointerException- if either argument isnull
-
delegate
-
domain
-