|
1 | 1 | /** |
2 | 2 | * Copyright 2016 Yurii Rashkovskii |
3 | | - * |
| 3 | + * <p> |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
6 | 6 | * You may obtain a copy of the License at |
7 | | - * |
8 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | - * |
| 7 | + * <p> |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * <p> |
10 | 10 | * Unless required by applicable law or agreed to in writing, software |
11 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
@@ -112,31 +112,32 @@ public GraphQLAnnotations getGraphQLAnnotations() { |
112 | 112 | public GraphQLSchema build() { |
113 | 113 | assert this.queryObject != null; |
114 | 114 |
|
115 | | - if (graphQLAnnotations == null) { |
116 | | - graphQLAnnotations = new GraphQLAnnotations(); |
| 115 | + if (this.graphQLAnnotations == null) { |
| 116 | + this.graphQLAnnotations = new GraphQLAnnotations(); |
117 | 117 | } |
118 | 118 |
|
119 | | - if (graphqlSchemaBuilder == null) { |
120 | | - graphqlSchemaBuilder = new GraphQLSchema.Builder(); |
| 119 | + if (this.graphqlSchemaBuilder == null) { |
| 120 | + this.graphqlSchemaBuilder = new GraphQLSchema.Builder(); |
121 | 121 | } |
122 | 122 |
|
123 | 123 | Set<GraphQLDirective> directives = directivesObjectList.stream().map(dir -> graphQLAnnotations.directive(dir)).collect(Collectors.toSet()); |
124 | | - Set<GraphQLType> additionalTypes = additionalTypesList.stream().map(x -> x.isInterface() ? |
125 | | - graphQLAnnotations.generateInterface(x) : graphQLAnnotations.object(x)).collect(Collectors.toSet()); |
| 124 | + Set<GraphQLType> additionalTypes = additionalTypesList.stream().map(additionalType -> |
| 125 | + additionalType.isInterface() ? |
| 126 | + graphQLAnnotations.generateInterface(additionalType) : graphQLAnnotations.object(additionalType)).collect(Collectors.toSet()); |
126 | 127 |
|
127 | | - graphqlSchemaBuilder.query(graphQLAnnotations.object(queryObject)); |
| 128 | + this.graphqlSchemaBuilder.query(graphQLAnnotations.object(queryObject)); |
128 | 129 | if (this.mutationObject != null) { |
129 | | - graphqlSchemaBuilder.mutation(graphQLAnnotations.object(mutationObject)); |
| 130 | + this.graphqlSchemaBuilder.mutation(graphQLAnnotations.object(mutationObject)); |
130 | 131 | } |
131 | 132 | if (this.subscriptionObject != null) { |
132 | | - graphqlSchemaBuilder.subscription(graphQLAnnotations.object(subscriptionObject)); |
| 133 | + this.graphqlSchemaBuilder.subscription(graphQLAnnotations.object(subscriptionObject)); |
133 | 134 | } |
134 | 135 | if (!this.directivesObjectList.isEmpty()) { |
135 | 136 | graphqlSchemaBuilder.additionalDirectives(directives); |
136 | 137 | } |
137 | | - graphqlSchemaBuilder.additionalTypes(additionalTypes).additionalType(Relay.pageInfoType) |
| 138 | + this.graphqlSchemaBuilder.additionalTypes(additionalTypes).additionalType(Relay.pageInfoType) |
138 | 139 | .codeRegistry(graphQLAnnotations.getContainer().getCodeRegistryBuilder().build()); |
139 | | - return graphqlSchemaBuilder.build(); |
| 140 | + return this.graphqlSchemaBuilder.build(); |
140 | 141 | } |
141 | 142 | } |
142 | 143 | } |
0 commit comments