Package io.micronaut.sourcegen.model
Record Class TypeDef.Array
java.lang.Object
java.lang.Record
io.micronaut.sourcegen.model.TypeDef.Array
- Record Components:
componentType
- The array component typedimensions
- The dimensionsnullable
- Is nullable
- All Implemented Interfaces:
TypeDef
- Enclosing interface:
- TypeDef
public static record TypeDef.Array(TypeDef componentType, int dimensions, boolean nullable)
extends Record
implements TypeDef
The type for representing an array.
- Since:
- 1.0
- Author:
- Andriy Dmytruk
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.sourcegen.model.TypeDef
TypeDef.Annotated, TypeDef.AnnotatedTypeDef, TypeDef.Array, TypeDef.Primitive, TypeDef.TypeVariable, TypeDef.Wildcard
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarray()
Create an array type.array
(int dimension) Create an array type.Returns the value of thecomponentType
record component.int
Returns the value of thedimensions
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.instantiate
(int size) Instantiate an array of this class.instantiate
(ExpressionDef... expressions) Instantiate an array of this class.instantiate
(List<? extends ExpressionDef> expressions) Instantiate an array of this class.boolean
isArray()
boolean
boolean
boolean
nullable()
Returns the value of thenullable
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Array
Creates an instance of aArray
record class.- Parameters:
componentType
- the value for thecomponentType
record componentdimensions
- the value for thedimensions
record componentnullable
- the value for thenullable
record component
-
-
Method Details
-
array
Description copied from interface:TypeDef
Create an array type. -
array
Description copied from interface:TypeDef
Create an array type. -
instantiate
Instantiate an array of this class.- Parameters:
size
- The size of the array- Returns:
- The instantiate expression
- Since:
- 1.5
-
instantiate
Instantiate an array of this class.- Parameters:
expressions
- The expressions- Returns:
- The instantiate expression
- Since:
- 1.5
-
instantiate
Instantiate an array of this class.- Parameters:
expressions
- The items expressions- Returns:
- The instantiate expression
- Since:
- 1.5
-
isNullable
public boolean isNullable()- Specified by:
isNullable
in interfaceTypeDef
- Returns:
- Is nullable type
-
makeNullable
- Specified by:
makeNullable
in interfaceTypeDef
- Returns:
- A new nullable type
-
isPrimitive
public boolean isPrimitive()- Specified by:
isPrimitive
in interfaceTypeDef
- Returns:
- Is primitive type
-
isArray
public boolean isArray() -
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 '=='. -
componentType
Returns the value of thecomponentType
record component.- Returns:
- the value of the
componentType
record component
-
dimensions
public int dimensions()Returns the value of thedimensions
record component.- Returns:
- the value of the
dimensions
record component
-
nullable
public boolean nullable()Returns the value of thenullable
record component.- Returns:
- the value of the
nullable
record component
-