Record Class EnumInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.EnumInfo
- Record Components:
name- the name of the enum class.constants- the constant values for this enum class.modelSubdir- the custom subdirectory to place this enum class definition, if any.modelSubpackage- the custom subpackage to place this enum class definition, if any.annotations- the annotations decorating this enum class.
- All Implemented Interfaces:
EntityInfo
public record EnumInfo(String name, List<String> constants, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations)
extends Record
implements EntityInfo
Describes an enum class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the complete set of normal imports for this entity and its sub-entities.Gets the complete set of static imports for this entity and its sub-entities.Returns the value of theannotationsrecord component.Returns the value of theconstantsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodelSubdirrecord component.Returns the value of themodelSubpackagerecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.withAddedAnnotation(AnnotationInfo annotation) Returns a newEnumInfoobject with specified annotation added.withModelSubdir(String modelSubdir) Returns a newEnumInfoobject with specified model subdirectory.withModelSubpackage(String modelSubpackage) Returns a newEnumInfoobject with specified model subpackage.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.torand.openapi2java.model.EntityInfo
aggregatedImports, annotationsAsStrings
-
Constructor Details
-
EnumInfo
Constructs anEnumInfoobject.- Parameters:
name- the enum name.constants- the enum constants.
-
EnumInfo
public EnumInfo(String name, List<String> constants, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations) Creates an instance of aEnumInforecord class.- Parameters:
name- the value for thenamerecord componentconstants- the value for theconstantsrecord componentmodelSubdir- the value for themodelSubdirrecord componentmodelSubpackage- the value for themodelSubpackagerecord componentannotations- the value for theannotationsrecord component
-
-
Method Details
-
withModelSubdir
Returns a newEnumInfoobject with specified model subdirectory.- Parameters:
modelSubdir- the model subdirectory.- Returns:
- the new and updated
EnumInfoobject.
-
withModelSubpackage
Returns a newEnumInfoobject with specified model subpackage.- Parameters:
modelSubpackage- the model subpackage.- Returns:
- the new and updated
EnumInfoobject.
-
withAddedAnnotation
Returns a newEnumInfoobject with specified annotation added.- Parameters:
annotation- the annotation to add.- Returns:
- the new and updated
EnumInfoobject.
-
aggregatedNormalImports
Description copied from interface:EntityInfoGets the complete set of normal imports for this entity and its sub-entities.- Specified by:
aggregatedNormalImportsin interfaceEntityInfo- Returns:
- the aggregated set of normal imports.
-
aggregatedStaticImports
Description copied from interface:EntityInfoGets the complete set of static imports for this entity and its sub-entities.- Specified by:
aggregatedStaticImportsin interfaceEntityInfo- Returns:
- the aggregated set of static imports.
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
constants
Returns the value of theconstantsrecord component.- Returns:
- the value of the
constantsrecord component
-
modelSubdir
Returns the value of themodelSubdirrecord component.- Returns:
- the value of the
modelSubdirrecord component
-
modelSubpackage
Returns the value of themodelSubpackagerecord component.- Returns:
- the value of the
modelSubpackagerecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceEntityInfo- Returns:
- the value of the
annotationsrecord component
-