Record Class PojoInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.PojoInfo
- Record Components:
name- the class name.modelSubdir- the model subdirectory to place the pojo.modelSubpackage- the model subpackage of the pojo.annotations- the annotations decorating this pojo.properties- the properties of this pojo.deprecationMessage- the deprecation message, if any.
- All Implemented Interfaces:
EntityInfo
public record PojoInfo(String name, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations, List<PropertyInfo> properties, String deprecationMessage)
extends Record
implements EntityInfo
Describes a pojo.
-
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 thedeprecationMessagerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanGets whether pojo is deprecated.booleanisEmpty()Gets whether pojo has no properties.Returns the value of themodelSubdirrecord component.Returns the value of themodelSubpackagerecord component.name()Returns the value of thenamerecord component.Returns the value of thepropertiesrecord component.final StringtoString()Returns a string representation of this record class.withAddedAnnotation(AnnotationInfo annotation) Returns a newPojoInfoobject with specified annotation added.withAddedProperties(Collection<PropertyInfo> properties) Returns a newPojoInfoobject with specified properties added.withDeprecationMessage(String deprecationMessage) Returns a newPojoInfoobject with specified deprecation message.withModelSubdir(String modelSubdir) Returns a newPojoInfoobject with specified model subdirectory.withModelSubpackage(String modelSubpackage) Returns a newPojoInfoobject 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
-
PojoInfo
Constructs aPojoInfoobject.- Parameters:
name- the class name.
-
PojoInfo
public PojoInfo(String name, String modelSubdir, String modelSubpackage, List<AnnotationInfo> annotations, List<PropertyInfo> properties, String deprecationMessage) Creates an instance of aPojoInforecord class.- Parameters:
name- the value for thenamerecord componentmodelSubdir- the value for themodelSubdirrecord componentmodelSubpackage- the value for themodelSubpackagerecord componentannotations- the value for theannotationsrecord componentproperties- the value for thepropertiesrecord componentdeprecationMessage- the value for thedeprecationMessagerecord component
-
-
Method Details
-
withModelSubdir
Returns a newPojoInfoobject with specified model subdirectory.- Parameters:
modelSubdir- the model subdirectory.- Returns:
- the new and updated
PojoInfoobject.
-
withModelSubpackage
Returns a newPojoInfoobject with specified model subpackage.- Parameters:
modelSubpackage- the model subpackage.- Returns:
- the new and updated
PojoInfoobject.
-
withAddedAnnotation
Returns a newPojoInfoobject with specified annotation added.- Parameters:
annotation- the annotation to add.- Returns:
- the new and updated
PojoInfoobject.
-
withAddedProperties
Returns a newPojoInfoobject with specified properties added.- Parameters:
properties- the properties to add.- Returns:
- the new and updated
PojoInfoobject.
-
withDeprecationMessage
Returns a newPojoInfoobject with specified deprecation message.- Parameters:
deprecationMessage- the deprecation message.- Returns:
- the new and updated
PojoInfoobject.
-
isDeprecated
public boolean isDeprecated()Gets whether pojo is deprecated.- Returns:
- true if pojo is deprecated; else false.
-
isEmpty
public boolean isEmpty()Gets whether pojo has no properties.- Returns:
- true if pojo has no properties; else false.
-
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
-
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
-
properties
Returns the value of thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-
deprecationMessage
Returns the value of thedeprecationMessagerecord component.- Returns:
- the value of the
deprecationMessagerecord component
-