Class TypeFacts
java.lang.Object
com.vaadin.hilla.parser.plugins.backbone.TypeFacts
What the walk says about the type of a value: whether a value of it can be
absent, the types it is given where it takes parameters, and whatever else a
plugin has to say about it, which the plugin reading it back knows the shape
of.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the types this one is given are its own, which they are not for the types the browser has one of its own for: the value of an optional, the items of an iterable and the values of a map are the type the walk carries below it instead.booleanWhether a value of the type can be absent, which is what the generated TypeScript says with a union with undefined.voidSays something about the type under the given name, which the plugin reading it back knows the shape of the values of.<T> Stream<T> What a plugin has said about the type under the given name as values of the given type, which is nothing at all where nothing was said.static TypeFactsof(SignatureModel type, boolean handleGenerics) What is known about a type before any plugin has said anything: whether a value of it can be absent, which is what Java says unless an annotation says otherwise, and whether the types it is given belong to it rather than to the value it holds.voidsetOptional(boolean optional) static TypeFactsunknown()What is known about a type nothing has been walked for.
-
Field Details
-
CONSTRAINTS
The name the plugin reading the annotations of the validation API says what they mean for a value under. The notes areValidationConstraints.- See Also:
-
ANNOTATIONS
The name the annotations of a value which a form model is told about are said under. The notes areAnnotations.- See Also:
-
-
Method Details
-
of
What is known about a type before any plugin has said anything: whether a value of it can be absent, which is what Java says unless an annotation says otherwise, and whether the types it is given belong to it rather than to the value it holds.- Parameters:
type- the type a value is ofhandleGenerics- whether a type variable stands for itself, which it does in an entity and does not in the signature of an endpoint method
-
unknown
What is known about a type nothing has been walked for. -
collectsTypeArguments
public boolean collectsTypeArguments()Whether the types this one is given are its own, which they are not for the types the browser has one of its own for: the value of an optional, the items of an iterable and the values of a map are the type the walk carries below it instead. -
isOptional
public boolean isOptional()Whether a value of the type can be absent, which is what the generated TypeScript says with a union with undefined. -
setOptional
public void setOptional(boolean optional) -
note
Says something about the type under the given name, which the plugin reading it back knows the shape of the values of. Saying it again replaces what was said before. -
notes
What a plugin has said about the type under the given name as values of the given type, which is nothing at all where nothing was said.
-