Record Class AnnotationInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.AnnotationInfo
- Record Components:
annotation- the annotation.imports- the imports required by the annotation.
- All Implemented Interfaces:
ImportsSupplier
public record AnnotationInfo(String annotation, ImportInfo imports)
extends Record
implements ImportsSupplier
Describes an annotation.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anAnnotationInfoobject.AnnotationInfo(String annotation) Constructs anAnnotationInfoobject.AnnotationInfo(String annotation, ImportInfo imports) Creates an instance of aAnnotationInforecord class.AnnotationInfo(String annotation, String annotationImport) Constructs anAnnotationInfoobject. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.imports()Returns the value of theimportsrecord component.final StringtoString()Returns a string representation of this record class.withAddedImports(ImportsSupplier importSupplier) Returns a newAnnotationInfoobject with specified imports added.withAddedImports(Collection<? extends ImportsSupplier> importSuppliers) Returns a newAnnotationInfoobject with specified imports added.withAddedNormalImport(String normalImport) Returns a newAnnotationInfoobject with specified normal import added.withAddedStaticImport(String staticImport) Returns a newAnnotationInfoobject with specified static import added.withAnnotation(String annotation) Returns a newAnnotationInfoobject with annotation.
-
Constructor Details
-
AnnotationInfo
public AnnotationInfo()Constructs anAnnotationInfoobject. -
AnnotationInfo
Constructs anAnnotationInfoobject.- Parameters:
annotation- the annoation.
-
AnnotationInfo
Constructs anAnnotationInfoobject.- Parameters:
annotation- the annotation.annotationImport- the import required by the annotation.
-
AnnotationInfo
Creates an instance of aAnnotationInforecord class.- Parameters:
annotation- the value for theannotationrecord componentimports- the value for theimportsrecord component
-
-
Method Details
-
withAnnotation
Returns a newAnnotationInfoobject with annotation.- Parameters:
annotation- the annotation.- Returns:
- the new and updated
AnnotationInfoobject.
-
withAddedNormalImport
Returns a newAnnotationInfoobject with specified normal import added.- Parameters:
normalImport- the import to add.- Returns:
- the new and updated
AnnotationInfoobject.
-
withAddedStaticImport
Returns a newAnnotationInfoobject with specified static import added.- Parameters:
staticImport- the static import to add.- Returns:
- the new and updated
AnnotationInfoobject.
-
withAddedImports
Returns a newAnnotationInfoobject with specified imports added.- Parameters:
importSupplier- the imports to add.- Returns:
- the new and updated
AnnotationInfoobject.
-
withAddedImports
Returns a newAnnotationInfoobject with specified imports added.- Parameters:
importSuppliers- the imports to add.- Returns:
- the new and updated
AnnotationInfoobject.
-
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
public final int 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). -
annotation
Returns the value of theannotationrecord component.- Returns:
- the value of the
annotationrecord component
-
imports
Returns the value of theimportsrecord component.- Specified by:
importsin interfaceImportsSupplier- Returns:
- the value of the
importsrecord component
-