public SpelNodeImpl(int startPos, int endPos, SpelNodeImpl... operands) { this.startPos = startPos; this.endPos = endPos; if (!ObjectUtils.isEmpty(operands)) { this.children = operands; for (SpelNodeImpl operand : operands) { Assert.notNull(operand, "Operand must not be null"); operand.parent = this; } } }
@Override public WebSocketHandlerRegistration addInterceptors(HandshakeInterceptor... interceptors) { if (!ObjectUtils.isEmpty(interceptors)) { this.interceptors.addAll(Arrays.asList(interceptors)); } return this; }
private static void assertNonEmptyAnnotationTypeArray(Class<?>[] annotationTypes, String message) { if (ObjectUtils.isEmpty(annotationTypes)) { throw new IllegalArgumentException(message); } for (Class<?> clazz : annotationTypes) { if (!Annotation.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException("Array elements must be of type Annotation"); } } }
@Override public WebSocketHandlerRegistration setAllowedOrigins(String... allowedOrigins) { this.allowedOrigins.clear(); if (!ObjectUtils.isEmpty(allowedOrigins)) { this.allowedOrigins.addAll(Arrays.asList(allowedOrigins)); } return this; }
@Override public StompWebSocketEndpointRegistration setAllowedOrigins(String... allowedOrigins) { this.allowedOrigins.clear(); if (!ObjectUtils.isEmpty(allowedOrigins)) { this.allowedOrigins.addAll(Arrays.asList(allowedOrigins)); } return this; }
@Nullable protected static Object findProvidedArgument(MethodParameter parameter, @Nullable Object... providedArgs) { if (!ObjectUtils.isEmpty(providedArgs)) { for (Object providedArg : providedArgs) { if (parameter.getParameterType().isInstance(providedArg)) { return providedArg; } } } return null; }
private boolean checkHttpMethod(String currentMethod) { String[] configuredMethods = getHttpMethods(); if (ObjectUtils.isEmpty(configuredMethods)) { return true; } for (String configuredMethod : configuredMethods) { if (configuredMethod.equalsIgnoreCase(currentMethod)) { return true; } } return false; }
private boolean checkBeanOfType(Class<?> beanType) { return (this.applicationContext == null || !ObjectUtils.isEmpty(BeanFactoryUtils.beanNamesForTypeIncludingAncestors( this.applicationContext, beanType, false, false))); }
@Override public DefaultDataBuffer write(DataBuffer... buffers) { if (!ObjectUtils.isEmpty(buffers)) { write(Arrays.stream(buffers).map(DataBuffer::asByteBuffer).toArray(ByteBuffer[]::new)); } return this; }
@Override public <T> T getBean(Class<T> requiredType, Object... args) throws BeansException { if (!ObjectUtils.isEmpty(args)) { throw new UnsupportedOperationException( "StaticListableBeanFactory does not support explicit bean creation arguments"); } return getBean(requiredType); }
@Override @Nullable public String[] getHeaderValues(String headerName) { String[] headerValues = StringUtils.toStringArray(getRequest().getHeaders(headerName)); return (!ObjectUtils.isEmpty(headerValues) ? headerValues : null); }
@Override public String buildErrorMessage() { StringBuilder msg = new StringBuilder(80); msg.append("Bean property '").append(getPropertyName()).append("' has no matching field."); if (!ObjectUtils.isEmpty(getPossibleMatches())) { msg.append(' '); appendHintMessage(msg); } return msg.toString(); } }
public void addInterceptors(HandlerInterceptor... interceptors) { if (!ObjectUtils.isEmpty(interceptors)) { CollectionUtils.mergeArrayIntoCollection(interceptors, initInterceptorList()); } }
/** * Evaluate the JSON path expression against the supplied {@code content} * and assert that a non-empty value exists at the given path. * <p>For the semantics of <em>empty</em>, consult the Javadoc for * {@link ObjectUtils#isEmpty(Object)}. * @param content the JSON content */ public void assertValueIsNotEmpty(String content) { Object value = evaluateJsonPath(content); AssertionErrors.assertTrue(failureReason("a non-empty value", value), !ObjectUtils.isEmpty(value)); }
/** * Filter on methods with the given parameter types. */ public Builder<T> argTypes(Class<?>... argTypes) { addFilter("argTypes=" + Arrays.toString(argTypes), method -> ObjectUtils.isEmpty(argTypes) ? method.getParameterCount() == 0 : Arrays.equals(method.getParameterTypes(), argTypes)); return this; }
/** * Filter on methods with the given parameter types. */ public Builder<T> argTypes(Class<?>... argTypes) { addFilter("argTypes=" + Arrays.toString(argTypes), method -> ObjectUtils.isEmpty(argTypes) ? method.getParameterCount() == 0 : Arrays.equals(method.getParameterTypes(), argTypes)); return this; }
@Test public void testADependencies() { String[] deps = this.dependentBeansFactory.getDependentBeans("a"); assertTrue(ObjectUtils.isEmpty(deps)); }