/** * The producing code can provide a callback to know when the subscriber attaches * * @param subscriptionCallback the callback when some ones */ public SingleSubscriberPublisher(OnSubscriptionCallback subscriptionCallback) { this.subscriptionCallback = assertNotNull(subscriptionCallback); }
private Builder putImpl(Object... kvs) { for (int i = 0; i < kvs.length; i = i + 2) { Object k = kvs[i]; Object v = kvs[i + 1]; map.put(assertNotNull(k), assertNotNull(v)); } return this; }
public Builder fields(List<GraphQLFieldDefinition> fieldDefinitions) { assertNotNull(fieldDefinitions, "fieldDefinitions can't be null"); fieldDefinitions.forEach(this::field); return this; }
private DataFetcherResult(T data, List<GraphQLError> errors, Object localContext) { this.data = data; this.errors = unmodifiableList(assertNotNull(errors)); this.localContext = localContext; }
private ExecutionPath(ExecutionPath parent, PathSegment segment) { this.parent = assertNotNull(parent, "Must provide a parent path"); this.segment = assertNotNull(segment, "Must provide a sub path"); pathList = toListImpl(); }
public Builder replaceChild(String key, int index, Node newChild) { assertNotNull(newChild); this.children.get(key).set(index, newChild); return this; }
public GraphQL build() { assertNotNull(graphQLSchema, "graphQLSchema must be non null"); return new GraphQL(this); } }
private static boolean hasDataFetcherImpl(FieldCoordinates coords, Map<FieldCoordinates, DataFetcherFactory> dataFetcherMap, Map<String, DataFetcherFactory> systemDataFetcherMap) { assertNotNull(coords); DataFetcherFactory dataFetcherFactory = systemDataFetcherMap.get(coords.getFieldName()); if (dataFetcherFactory == null) { dataFetcherFactory = dataFetcherMap.get(coords); } return dataFetcherFactory != null; }
public Builder withDirective(GraphQLDirective directive) { assertNotNull(directive, "directive can't be null"); directives.put(directive.getName(), directive); return this; }
public Builder field(GraphQLFieldDefinition fieldDefinition) { assertNotNull(fieldDefinition, "fieldDefinition can't be null"); this.fields.put(fieldDefinition.getName(), fieldDefinition); return this; }
private GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy, ExecutionStrategy mutationStrategy, ExecutionStrategy subscriptionStrategy, ExecutionIdProvider idProvider, Instrumentation instrumentation, PreparsedDocumentProvider preparsedDocumentProvider) { this.graphQLSchema = assertNotNull(graphQLSchema, "graphQLSchema must be non null"); this.queryStrategy = queryStrategy != null ? queryStrategy : new AsyncExecutionStrategy(); this.mutationStrategy = mutationStrategy != null ? mutationStrategy : new AsyncSerialExecutionStrategy(); this.subscriptionStrategy = subscriptionStrategy != null ? subscriptionStrategy : new SubscriptionExecutionStrategy(); this.idProvider = assertNotNull(idProvider, "idProvider must be non null"); this.instrumentation = checkInstrumentation(assertNotNull(instrumentation)); this.preparsedDocumentProvider = assertNotNull(preparsedDocumentProvider, "preparsedDocumentProvider must be non null"); }
public GraphQLNonNull(GraphQLType wrappedType) { assertNotNull(wrappedType, "wrappedType can't be null"); assertNonNullWrapping(wrappedType); this.wrappedType = wrappedType; }
public TypeMismatchError(ExecutionPath path, GraphQLType expectedType) { this.path = assertNotNull(path).toList(); this.expectedType = assertNotNull(expectedType); this.message = mkMessage(path, expectedType); }
public Builder withDirectives(GraphQLDirective... directives) { assertNotNull(directives, "directives can't be null"); for (GraphQLDirective directive : directives) { withDirective(directive); } return this; }
public Builder withDirective(GraphQLDirective directive) { assertNotNull(directive, "directive can't be null"); directives.put(directive.getName(), directive); return this; }
public Builder field(GraphQLInputObjectField field) { assertNotNull(field, "field can't be null"); fields.put(field.getName(), field); return this; }
public Builder withDirective(GraphQLDirective directive) { assertNotNull(directive, "directive can't be null"); directives.put(directive.getName(), directive); return this; }
public Builder argument(GraphQLArgument argument) { Assert.assertNotNull(argument, "argument must not be null"); arguments.put(argument.getName(), argument); return this; }
public ListExecutionResultNode(FetchedValueAnalysis fetchedValueAnalysis, List<ExecutionResultNode> children) { super(fetchedValueAnalysis, ResultNodesUtil.newNullableException(fetchedValueAnalysis, children)); this.children = Assert.assertNotNull(children); children.forEach(Assert::assertNotNull); }
@Override public void execute(final Runnable command) { final RunNode newNode = new RunNode(assertNotNull(command, "Runnable must not be null")); final RunNode prevLast = last.getAndSet(newNode); if (prevLast != null) prevLast.lazySet(newNode); else runAll(newNode); }