Refine search
private void assertContentsOfScriptArray(Resource... scripts) { Assert.notNull(scripts, "Scripts array must not be null"); Assert.noNullElements(scripts, "Scripts array must not contain null elements"); }
public ChainingStrategy(EndpointDetectionStrategy... delegates) { Assert.notNull(delegates, "'delegates' must not be null."); Assert.noNullElements(delegates, "'delegates' must not contain null."); this.delegates = delegates; }
/** * Create a {@code FilterChain} with Filter's and a Servlet. * @param servlet the {@link Servlet} to invoke in this {@link FilterChain} * @param filters the {@link Filter}'s to invoke in this {@link FilterChain} * @since 3.2 */ public MockFilterChain(Servlet servlet, Filter... filters) { Assert.notNull(filters, "filters cannot be null"); Assert.noNullElements(filters, "filters cannot contain null values"); this.filters = initFilterList(servlet, filters); }
/** * Private constructor, not for direct instantiation. * @see org.springframework.test.web.servlet.setup.MockMvcBuilders */ MockMvc(TestDispatcherServlet servlet, Filter... filters) { Assert.notNull(servlet, "DispatcherServlet is required"); Assert.notNull(filters, "Filters cannot be null"); Assert.noNullElements(filters, "Filters cannot contain null values"); this.servlet = servlet; this.filters = filters; this.servletContext = servlet.getServletContext(); }
public ProbeEndpointsStrategy(InstanceWebClient instanceWebClient, String[] endpoints) { Assert.notNull(endpoints, "'endpoints' must not be null."); Assert.noNullElements(endpoints, "'endpoints' must not contain null."); this.endpoints = Arrays.stream(endpoints).map(EndpointDefinition::create).collect(Collectors.toList()); this.instanceWebClient = instanceWebClient; }
@Override public ConnectFromBuilder startWith(AggregationExpression... expressions) { Assert.notNull(expressions, "AggregationExpressions must not be null!"); Assert.noNullElements(expressions, "AggregationExpressions must not contain null elements!"); this.startWith = Arrays.asList(expressions); return this; }
private Criteria positions(String operator, List<Integer> positions) { Assert.notNull(positions, "Positions must not be null!"); Assert.noNullElements(positions.toArray(), "Positions must not contain null values."); target.criteria.put(operator, positions); return target; }
/** * Create a {@code FilterChain} with Filter's and a Servlet. * @param servlet the {@link Servlet} to invoke in this {@link FilterChain} * @param filters the {@link Filter}'s to invoke in this {@link FilterChain} * @since 3.2 */ public MockFilterChain(Servlet servlet, Filter... filters) { Assert.notNull(filters, "filters cannot be null"); Assert.noNullElements(filters, "filters cannot contain null values"); this.filters = initFilterList(servlet, filters); }
/** * Creates a criterion using the {@literal $type} operator. * * @param types must not be {@literal null}. * @return this * @since 2.1 * @see <a href="https://docs.mongodb.com/manual/reference/operator/query/type/">MongoDB Query operator: $type</a> */ public Criteria type(Type... types) { Assert.notNull(types, "Types must not be null!"); Assert.noNullElements(types, "Types must not contain null."); criteria.put("$type", Arrays.asList(types).stream().map(Type::value).collect(Collectors.toList())); return this; }
@Override public ConnectFromBuilder startWith(Object... expressions) { Assert.notNull(expressions, "Expressions must not be null!"); Assert.noNullElements(expressions, "Expressions must not contain null elements!"); this.startWith = verifyAndPotentiallyTransformStartsWithTypes(expressions); return this; }
/** * Creates new unsafe {@link JpaSort} based on given {@link Direction} and properties. * * @param direction must not be {@literal null}. * @param properties must not be {@literal null} or empty. * @return */ public static JpaSort unsafe(Direction direction, String... properties) { Assert.notNull(direction, "Direction must not be null!"); Assert.notEmpty(properties, "Properties must not be empty!"); Assert.noNullElements(properties, "Properties must not contain null values!"); return unsafe(direction, Arrays.asList(properties)); }
@Override public ConnectFromBuilder startWith(String... fieldReferences) { Assert.notNull(fieldReferences, "FieldReferences must not be null!"); Assert.noNullElements(fieldReferences, "FieldReferences must not contain null elements!"); List<Object> fields = new ArrayList<Object>(fieldReferences.length); for (String fieldReference : fieldReferences) { fields.add(Fields.field(fieldReference)); } this.startWith = fields; return this; }
@Override public Mono<Void> pSubscribe(ByteBuffer... patterns) { Assert.notNull(patterns, "Patterns must not be null!"); Assert.noNullElements(patterns, "Patterns must not contain null elements!"); return patternState.subscribe(patterns, commands::psubscribe); }
@Override public Mono<Void> unsubscribe(ByteBuffer... channels) { Assert.notNull(channels, "Channels must not be null!"); Assert.noNullElements(channels, "Channels must not contain null elements!"); return ObjectUtils.isEmpty(channels) ? Mono.empty() : channelState.unsubscribe(channels, commands::unsubscribe); }
@Override public Mono<Void> subscribe(ByteBuffer... channels) { Assert.notNull(channels, "Channels must not be null!"); Assert.noNullElements(channels, "Channels must not contain null elements!"); return channelState.subscribe(channels, commands::subscribe); }
@Override public Mono<Void> pUnsubscribe(ByteBuffer... patterns) { Assert.notNull(patterns, "Patterns must not be null!"); Assert.noNullElements(patterns, "Patterns must not contain null elements!"); return ObjectUtils.isEmpty(patterns) ? Mono.empty() : patternState.unsubscribe(patterns, commands::punsubscribe); }
/** * Set the plain filter chain to apply. * * @param pipeline must not be {@literal null} nor contain {@literal null} values. * @return this. * @see ChangeStreamOptions#getFilter() */ public ChangeStreamRequestBuilder<T> filter(Document... pipeline) { Assert.notNull(pipeline, "Aggregation pipeline must not be null!"); Assert.noNullElements(pipeline, "Aggregation pipeline must not contain null elements!"); this.delegate.filter(pipeline); return this; }
/** * Subscribe to one or more {@link ChannelTopic}s and receive a stream of {@link ChannelMessage}. Messages and channel * names are treated as {@link String}. The message stream subscribes lazily to the Redis channels and unsubscribes if * the {@link org.reactivestreams.Subscription} is {@link org.reactivestreams.Subscription#cancel() cancelled}. * * @param channelTopics the channels to subscribe. * @return the message stream. * @throws InvalidDataAccessApiUsageException if {@code patternTopics} is empty. * @see #receive(Iterable, SerializationPair, SerializationPair) */ public Flux<Message<String, String>> receive(ChannelTopic... channelTopics) { Assert.notNull(channelTopics, "ChannelTopics must not be null!"); Assert.noNullElements(channelTopics, "ChannelTopics must not contain null elements!"); return receive(Arrays.asList(channelTopics), stringSerializationPair, stringSerializationPair); }
/** * Configures {@literal boundaries} and return a new {@link BucketOperation}. Existing {@literal boundaries} are * preserved and the new {@literal boundaries} are appended. * * @param boundaries must not be {@literal null}. * @return */ public BucketOperation withBoundaries(Object... boundaries) { Assert.notNull(boundaries, "Boundaries must not be null!"); Assert.noNullElements(boundaries, "Boundaries must not contain null values!"); List<Object> newBoundaries = new ArrayList<Object>(this.boundaries.size() + boundaries.length); newBoundaries.addAll(this.boundaries); newBoundaries.addAll(Arrays.asList(boundaries)); return new BucketOperation(this, newBoundaries, defaultBucket); }
/** * Create a {@code FilterChain} with Filter's and a Servlet. * @param servlet the {@link Servlet} to invoke in this {@link FilterChain} * @param filters the {@link Filter}'s to invoke in this {@link FilterChain} * @since 3.2 */ public MockFilterChain(Servlet servlet, Filter... filters) { Assert.notNull(filters, "filters cannot be null"); Assert.noNullElements(filters, "filters cannot contain null values"); this.filters = initFilterList(servlet, filters); }