Record Class PropertyInfo
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.model.PropertyInfo
- Record Components:
name- the property names.type- the property type.required- the required flag.annotations- the annotations decorating this pojo.deprecationMessage- the deprecation message, if any.
- All Implemented Interfaces:
EntityInfo
public record PropertyInfo(String name, TypeInfo type, boolean required, List<AnnotationInfo> annotations, String deprecationMessage)
extends Record
implements EntityInfo
Describes a property.
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyInfo(String name) Constructs aPropertyInfoobject.PropertyInfo(String name, TypeInfo type, boolean required, List<AnnotationInfo> annotations, String deprecationMessage) Creates an instance of aPropertyInforecord class. -
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 property is deprecated.name()Returns the value of thenamerecord component.booleanrequired()Returns the value of therequiredrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.withAddedAnnotation(AnnotationInfo annotation) Returns a newPropertyInfoobject with specified annotation added.withDeprecationMessage(String deprecationMessage) Returns a newPropertyInfoobject with specified deprecation message.withRequired(boolean required) Returns a newPropertyInfoobject with specified required flag.Returns a newPropertyInfoobject with specified type.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
-
PropertyInfo
Constructs aPropertyInfoobject.- Parameters:
name- the property name.
-
PropertyInfo
public PropertyInfo(String name, TypeInfo type, boolean required, List<AnnotationInfo> annotations, String deprecationMessage) Creates an instance of aPropertyInforecord class.- Parameters:
name- the value for thenamerecord componenttype- the value for thetyperecord componentrequired- the value for therequiredrecord componentannotations- the value for theannotationsrecord componentdeprecationMessage- the value for thedeprecationMessagerecord component
-
-
Method Details
-
withType
Returns a newPropertyInfoobject with specified type.- Parameters:
type- the property type.- Returns:
- the new and updated
PropertyInfoobject.
-
withRequired
Returns a newPropertyInfoobject with specified required flag.- Parameters:
required- the required flag.- Returns:
- the new and updated
PropertyInfoobject.
-
withAddedAnnotation
Returns a newPropertyInfoobject with specified annotation added.- Parameters:
annotation- the annotation to add.- Returns:
- the new and updated
PropertyInfoobject.
-
withDeprecationMessage
Returns a newPropertyInfoobject with specified deprecation message.- Parameters:
deprecationMessage- the deprecation message.- Returns:
- the new and updated
PropertyInfoobject.
-
isDeprecated
public boolean isDeprecated()Gets whether property is deprecated.- Returns:
- true if property is deprecated; 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceEntityInfo- Returns:
- the value of the
annotationsrecord component
-
deprecationMessage
Returns the value of thedeprecationMessagerecord component.- Returns:
- the value of the
deprecationMessagerecord component
-