Package com.vaadin.hilla.generator.model
Record Class UnionModel
java.lang.Object
java.lang.Record
com.vaadin.hilla.generator.model.UnionModel
- Record Components:
javaClass- the fully qualified name of the Java class declaring the subtypessubTypes- the types a value can be, in the order they are declared in
The subtypes a polymorphic type is one of, which TypeScript can say as a
union while Java says it as a hierarchy.
It is generated next to the type itself rather than instead of it: the type says what every one of the subtypes has, and the union says which of them a value can be, so that reading the discriminator of a value tells TypeScript which subtype it is looking at.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne of the types a value can be. -
Constructor Summary
ConstructorsConstructorDescriptionUnionModel(String javaClass, List<UnionModel.Member> subTypes) Creates an instance of aUnionModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thejavaClassrecord component.subTypes()Returns the value of thesubTypesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
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). -
javaClass
Returns the value of thejavaClassrecord component.- Returns:
- the value of the
javaClassrecord component
-
subTypes
Returns the value of thesubTypesrecord component.- Returns:
- the value of the
subTypesrecord component
-