private NodePrinter<InterfaceTypeDefinition> interfaceTypeDefinition() { return (out, node) -> { out.printf("%s", comments(node)); out.printf("%s", spaced( "interface", node.getName(), directives(node.getDirectives()), block(node.getFieldDefinitions()) ) ); }; }
@Override public TraversalControl visitInterfaceTypeDefinition(InterfaceTypeDefinition node, TraverserContext<Node> context) { InterfaceTypeDefinition changedNode = node.transform(builder -> { builder.directives(sort(node.getDirectives(), comparing(Directive::getName))); builder.definitions(sort(node.getFieldDefinitions(), comparing(FieldDefinition::getName))); }); return changeNode(context, changedNode); }
private Builder(InterfaceTypeDefinition existing) { this.sourceLocation = existing.getSourceLocation(); this.comments = existing.getComments(); this.name = existing.getName(); this.description = existing.getDescription(); this.directives = existing.getDirectives(); this.definitions = existing.getFieldDefinitions(); this.ignoredChars = existing.getIgnoredChars(); }
buildDirectives(typeDefinition.getDirectives(), directivesOf(extensions), OBJECT, buildCtx.getDirectiveDefinitions()) );
private NodePrinter<InterfaceTypeDefinition> interfaceTypeDefinition() { return (out, node) -> { out.printf("%s", comments(node)); out.printf("%s", spaced( "interface", node.getName(), directives(node.getDirectives()), block(node.getFieldDefinitions()) ) ); }; }
@Override public TraversalControl visitInterfaceTypeDefinition(InterfaceTypeDefinition node, TraverserContext<Node> context) { InterfaceTypeDefinition changedNode = node.transform(builder -> { builder.directives(sort(node.getDirectives(), comparing(Directive::getName))); builder.definitions(sort(node.getFieldDefinitions(), comparing(FieldDefinition::getName))); }); return changeNode(context, changedNode); }
private static List<Directive> getDirectives(Definition def) { if ( def instanceof ObjectTypeDefinition ) { return ((ObjectTypeDefinition)def).getDirectives(); } if ( def instanceof InterfaceTypeDefinition ) { return ((InterfaceTypeDefinition)def).getDirectives(); } if ( def instanceof EnumTypeDefinition ) { return ((EnumTypeDefinition)def).getDirectives(); } if ( def instanceof ScalarTypeDefinition ) { return ((ScalarTypeDefinition)def).getDirectives(); } if ( def instanceof UnionTypeDefinition ) { return ((UnionTypeDefinition)def).getDirectives(); } if ( def instanceof InputObjectTypeDefinition ) { return ((InputObjectTypeDefinition)def).getDirectives(); } if ( def instanceof SchemaDefinition ) { return ((SchemaDefinition)def).getDirectives(); } return Collections.emptyList(); }
private Builder(InterfaceTypeDefinition existing) { this.sourceLocation = existing.getSourceLocation(); this.comments = existing.getComments(); this.name = existing.getName(); this.description = existing.getDescription(); this.directives = existing.getDirectives(); this.definitions = existing.getFieldDefinitions(); this.ignoredChars = existing.getIgnoredChars(); }
buildDirectives(typeDefinition.getDirectives(), directivesOf(extensions), OBJECT, buildCtx.getDirectiveDefinitions()) );