- if (potential instanceof ContainerSchemaNode) {
- return new Container((ContainerSchemaNode) potential);
- } else if (potential instanceof ListSchemaNode) {
- return fromListSchemaNode((ListSchemaNode) potential);
- } else if (potential instanceof LeafSchemaNode) {
- return new Leaf((LeafSchemaNode) potential);
- } else if (potential instanceof ChoiceSchemaNode) {
- return new Choice((ChoiceSchemaNode) potential);
- } else if (potential instanceof LeafListSchemaNode) {
- return fromLeafListSchemaNode((LeafListSchemaNode) potential);
- } else if (potential instanceof AnyxmlSchemaNode) {
- return new AnyXml((AnyxmlSchemaNode) potential);
- }
+ if (potential instanceof ContainerSchemaNode container) {
+ return new Container(container);
+ } else if (potential instanceof ListSchemaNode list) {
+ return fromListSchemaNode(list);
+ } else if (potential instanceof LeafSchemaNode leaf) {
+ return new Leaf(leaf);
+ } else if (potential instanceof ChoiceSchemaNode choice) {
+ return new Choice(choice);
+ } else if (potential instanceof LeafListSchemaNode leafList) {
+ return fromLeafListSchemaNode(leafList);
+ } else if (potential instanceof AnyxmlSchemaNode anyxml) {
+ return new AnyXml(anyxml);
+ }
+ // FIXME: unhandled anydata!