public CompositeOptionalObjectsController(OptionalObjectsController... controllers) { checkArgument(!ArrayUtils.isEmpty(controllers), "cannot compose empty controllers list"); this.controllers = ImmutableList.copyOf(controllers); }
if (Object.class.isAssignableFrom(componentType)) result = ArrayUtils.toString((ArrayUtils.subarray((Object[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((boolean[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((byte[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((char[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((short[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((int[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((long[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((float[]) array, 0, maxElements))); result = ArrayUtils.toString((ArrayUtils.subarray((double[]) array, 0, maxElements)));
public RestrictedSSLSocketFactory(SSLContext sslContext, String[] cipherSuites, String[] protocols) { this.sslSocketFactory = sslContext.getSocketFactory(); if (cipherSuites == null) { cipherSuites = sslSocketFactory.getDefaultCipherSuites(); } this.enabledCipherSuites = ArrayUtils.intersection(cipherSuites, sslSocketFactory.getSupportedCipherSuites()); this.defaultCipherSuites = ArrayUtils.intersection(cipherSuites, sslSocketFactory.getDefaultCipherSuites()); if (protocols == null) { protocols = sslContext.getDefaultSSLParameters().getProtocols(); } this.enabledProtocols = ArrayUtils.intersection(protocols, sslContext.getSupportedSSLParameters().getProtocols()); }
return ArrayUtils.toString(o, MAX_ELEMENTS);
public MuleCredentials(String username, char[] password) { this.username = username; this.password = ArrayUtils.clone(password); }
private int getSize(Object value) { checkArgument(value != null, "Cannot check size of a null value"); if (value instanceof String) { return ((String) value).length(); } else if (value instanceof Collection) { return ((Collection<?>) value).size(); } else if (value instanceof Map) { return ((Map<?, ?>) value).size(); } else if (value.getClass().isArray()) { return ArrayUtils.getLength(value); } else { throw new IllegalArgumentException( String.format( "Only instances of Map, Collection, Array and String can be checked for size. Instance of %s was found instead", value.getClass().getName())); } }
protected MuleDefinitionParserConfiguration addDelegate(MuleDefinitionParser delegate) { delegates = (MuleDefinitionParser[]) ArrayUtils.add(delegates, delegate); return delegate; }
public void setSslType(String sslType) { String[] enabledProtocols = tlsProperties.getEnabledProtocols(); if (enabledProtocols != null && !ArrayUtils.contains(enabledProtocols, sslType)) { throw new IllegalArgumentException(format("Protocol %s is not allowed in current configuration", sslType)); } this.sslType = sslType; }
CoreMessages.methodWithParamsNotFoundOnObject(methodName, ArrayUtils.toString(argTypes), remoteObject.getClass()).toString());
public MuleCredentials(String username, char[] password, Object roles) { this.username = username; this.password = ArrayUtils.clone(password); this.roles = roles; }
if (ArrayUtils.getLength(value) > 0)
/** * Verifies that none of the {@link Described} items in {@code describedCollection} have an * equivalent value for {@link Described#getName()} * * @param describedCollections an array of {@link Collection}s with instances of {@link Described} * @throws IllegalArgumentException if the validation fails */ public static void validateRepeatedNames(Collection<? extends Described>... describedCollections) { if (ArrayUtils.isEmpty(describedCollections)) { return; } List<Described> all = new ArrayList<>(); for (Collection<? extends Described> describedCollection : describedCollections) { all.addAll(describedCollection); } Set<String> clashes = collectRepeatedNames(all); if (!clashes.isEmpty()) { throw new IllegalArgumentException("The following names have been assigned to multiple components: " + Joiner.on(", ").join(clashes)); } }
if (logger.isDebugEnabled()) logger.debug("There is/are " + resources.length + " configuration resource(s): " + ArrayUtils.toString(resources));
public RestrictedSSLServerSocketFactory(SSLContext sslContext, String[] cipherSuites, String[] protocols) { this.sslServerSocketFactory = sslContext.getServerSocketFactory(); if (cipherSuites == null) { cipherSuites = sslServerSocketFactory.getDefaultCipherSuites(); } this.enabledCipherSuites = ArrayUtils.intersection(cipherSuites, sslServerSocketFactory.getSupportedCipherSuites()); this.defaultCipherSuites = ArrayUtils.intersection(cipherSuites, sslServerSocketFactory.getDefaultCipherSuites()); if (protocols == null) { protocols = sslContext.getDefaultSSLParameters().getProtocols(); } this.enabledProtocols = ArrayUtils.intersection(protocols, sslContext.getSupportedSSLParameters().getProtocols()); if (this.enabledProtocols.length != protocols.length) { logger.warn("Current context supports less SSL protocols than configured. Only the following are enabled: [{}]", Joiner.on(", ").join(this.enabledProtocols)); } }
public char[] getPassword() { return ArrayUtils.clone(password); }
if (ArrayUtils.getLength(value) == 0)
@Override public void onList() { if (!ArrayUtils.isEmpty(parameterType.getGenericTypes())) { registerTopLevelParameter(extension, parameterType.getGenericTypes()[0]); } }
public void initialise() throws InitialisationException { // Load Spring XML in-memory if (configXml != null) { final String encoding = MuleManager.getConfiguration().getEncoding(); Resource[] resources; try { resources = new Resource[]{new CachedResource(configXml, MuleManager.getConfiguration().getEncoding())}; } catch (UnsupportedEncodingException e) { throw new InitialisationException(CoreMessages.failedToConvertStringUsingEncoding(encoding), e); } setExternalBeanFactory(new MuleApplicationContext(resources)); } // Load Spring XML from one or more config files else if (configResources != null) { String[] resources = StringUtils.splitAndTrim(configResources, ","); if (logger.isDebugEnabled()) { logger.debug("There is/are " + resources.length + " configuration resource(s): " + ArrayUtils.toString(resources)); } setExternalBeanFactory(new MuleApplicationContext(resources)); } }
if (globalEnabledProtocols != null) String[] validProtocols = ArrayUtils.intersection(enabledProtocols, globalEnabledProtocols); if (validProtocols.length < enabledProtocols.length) if (globalEnabledCipherSuites != null) String[] validCipherSuites = ArrayUtils.intersection(enabledCipherSuites, globalEnabledCipherSuites); if (validCipherSuites.length < enabledCipherSuites.length)
private DataType getFirstGenericType(DataType type) { return ArrayUtils.isEmpty(type.getGenericTypes()) ? type : type.getGenericTypes()[0]; }