Package com.vaadin.hilla.generator.model
Record Class TypeModel.Scalar
java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.TypeModel.Scalar
- Record Components:
javaType- the fully qualified name of the Java type the value comes from, which TypeScript has no way of telling apart: a date and an instant are both written as a string
- All Implemented Interfaces:
TypeModel
- Enclosing interface:
TypeModel
public static record TypeModel.Scalar(TypeModel.ScalarKind kind, boolean optional, String javaType, List<ConstraintModel> constraints, List<AnnotationModel> annotations)
extends Record
implements TypeModel
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.hilla.generator.model.TypeModel
TypeModel.ArrayOf, TypeModel.Builder, TypeModel.EntityRef, TypeModel.MapOf, TypeModel.Provided, TypeModel.Scalar, TypeModel.ScalarKind, TypeModel.TypeVariable -
Constructor Summary
ConstructorsConstructorDescriptionScalar(TypeModel.ScalarKind kind, boolean optional, String javaType) Scalar(TypeModel.ScalarKind kind, boolean optional, String javaType, List<ConstraintModel> constraints, List<AnnotationModel> annotations) Creates an instance of aScalarrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theannotationsrecord component.Returns the value of theconstraintsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.javaType()Returns the value of thejavaTyperecord component.kind()Returns the value of thekindrecord component.static TypeModel.Scalarof(TypeModel.ScalarKind kind, String javaType) booleanoptional()Returns the value of theoptionalrecord component.final StringtoString()Returns a string representation of this record class.withOptional(boolean optional) The same type, said to be absent or not as given.
-
Constructor Details
-
Scalar
public Scalar(TypeModel.ScalarKind kind, boolean optional, String javaType, List<ConstraintModel> constraints, List<AnnotationModel> annotations) Creates an instance of aScalarrecord class.- Parameters:
kind- the value for thekindrecord componentoptional- the value for theoptionalrecord componentjavaType- the value for thejavaTyperecord componentconstraints- the value for theconstraintsrecord componentannotations- the value for theannotationsrecord component
-
Scalar
-
-
Method Details
-
of
-
withOptional
Description copied from interface:TypeModelThe same type, said to be absent or not as given.- Specified by:
withOptionalin interfaceTypeModel
-
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 '=='. -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
optional
public boolean optional()Returns the value of theoptionalrecord component. -
javaType
Returns the value of thejavaTyperecord component.- Returns:
- the value of the
javaTyperecord component
-
constraints
Returns the value of theconstraintsrecord component.- Specified by:
constraintsin interfaceTypeModel- Returns:
- the value of the
constraintsrecord component
-
annotations
Returns the value of theannotationsrecord component.- Specified by:
annotationsin interfaceTypeModel- Returns:
- the value of the
annotationsrecord component
-