Package com.vaadin.copilot.javarewriter
Record Class JavaRewriter.JavaComponent
java.lang.Object
java.lang.Record
com.vaadin.copilot.javarewriter.JavaRewriter.JavaComponent
- Record Components:
tag- the tag of the component, used to determine the Java classclassName- the class name if known, or null to use the tag to look up the classprops- the properties of the componentchildren- the child components
- Enclosing class:
- JavaRewriter
public static record JavaRewriter.JavaComponent(String tag, String className, Map<String,Object> props, List<JavaRewriter.JavaComponent> children)
extends Record
Represents a Java component to be added to the source code.
-
Constructor Summary
ConstructorsConstructorDescriptionJavaComponent(String tag, String className, Map<String, Object> props, List<JavaRewriter.JavaComponent> children) Creates an instance of aJavaComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchildren()Returns the value of thechildrenrecord component.Returns the value of theclassNamerecord component.static JavaRewriter.JavaComponentcomponentFromJson(elemental.json.JsonObject json) Creates a new JavaComponent instance from a JSON object.static List<JavaRewriter.JavaComponent>componentsFromJson(elemental.json.JsonArray template) Creates a new JavaComponent instance from a JSON array.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.props()Returns the value of thepropsrecord component.tag()Returns the value of thetagrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
componentFromJson
Creates a new JavaComponent instance from a JSON object.- Parameters:
json- the JSON object- Returns:
- the JavaComponent instance
-
componentsFromJson
public static List<JavaRewriter.JavaComponent> componentsFromJson(elemental.json.JsonArray template) Creates a new JavaComponent instance from a JSON array.- Parameters:
template- the JSON array- Returns:
- the JavaComponent instances
-
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). -
tag
Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-
className
Returns the value of theclassNamerecord component.- Returns:
- the value of the
classNamerecord component
-
props
Returns the value of thepropsrecord component.- Returns:
- the value of the
propsrecord component
-
children
Returns the value of thechildrenrecord component.- Returns:
- the value of the
childrenrecord component
-