public ConstantFactoryBean(T value) { checkArgument(value != null, "value cannot be null"); this.value = value; }
@Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { checkArgument(beanFactory instanceof BeanDefinitionRegistry, "this bootstrap class only accepts BeanFactory instances which implement " + BeanDefinitionRegistry.class); beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory; }
public ResourceKey(Object resourceFactory) { Preconditions.checkArgument(resourceFactory != null, "resourceFactory cannot be null"); this.resourceFactory = resourceFactory; this.resource = null; }
public HttpRequestCacheKey(final String url, final OptionsType operationOptions, final MessageExchangePattern exchangePattern) { Preconditions.checkArgument(url != null, "URL cannot be null"); Preconditions.checkArgument(operationOptions != null, "Operation options cannot be null"); Preconditions.checkArgument(exchangePattern != null, "Exchange pattern cannot be null"); this.url = url; this.operationOptions = operationOptions; this.exchangePattern = exchangePattern; }
/** * @param sslSession the SSL session * @param remoteHostAddress */ public ClientConnection(SSLSession sslSession, InetSocketAddress remoteHostAddress) { Preconditions.checkArgument(sslSession != null, "sslSession cannot be null."); Preconditions.checkArgument(remoteHostAddress != null, "remoteHostAddress cannot be null."); this.sslSession = sslSession; this.remoteHostAddress = remoteHostAddress; }
public RegistryDelegatingInjector(RegistryProvider registryProvider) { checkArgument(registryProvider != null, "registryProvider cannot be null"); this.registryProvider = registryProvider; }
public void setStartDelay(long startDelay) { checkArgument(startDelay >= 0, "Start delay must be greater then zero"); this.startDelay = startDelay; }
/** * Creates a new instance * * @param muleContext the MuleContext for the current Mule artifact. Non null */ public AsynchronousUntilSuccessfulProcessingStrategy(MuleContext muleContext) { checkArgument(muleContext != null, "muleContext cannot be null"); this.muleContext = muleContext; }
public ParameterGroup(Class<?> type, Field field) { checkArgument(type != null, "type cannot be null"); checkArgument(field != null, "field cannot be null"); this.type = type; this.field = field; field.setAccessible(true); }
/** * Construct a new instance and set the {@link #key} that will be used * to access the registry * * @param key a not blank {@link String} */ public RegistryLookupValueResolver(String key) { checkArgument(!StringUtils.isBlank(key), "key cannot be null or blank"); this.key = key; }
protected AbstractImmutableDescribed(String name, String description) { checkArgument(!StringUtils.isBlank(name), "Name attribute cannot be null or blank"); this.name = name; this.description = description != null ? description : EMPTY; }
/** * {@inheritDoc} */ @Override protected <T> T doDeserialize(InputStream inputStream, ClassLoader classLoader) throws Exception { checkArgument(inputStream != null, "Cannot deserialize a null stream"); checkArgument(classLoader != null, "Cannot deserialize with a null classloader"); return (T) SerializationUtils.deserialize(inputStream, classLoader, muleContext); }
private <K, V> void idempotentPut(Map<K, V> map, K key, V value) { checkArgument(value != null, "value cannot be null"); if (map.containsKey(key)) { throw new IllegalStateException(String.format("A %s is already registered for the name '%s'", value.getClass().getSimpleName(), key)); } map.put(key, value); } }
private void validate(boolean anon) throws CreateException { if (!anon) { checkArgument(getKeyStore() != null, "The KeyStore location cannot be null"); checkArgument(getKeyPassword() != null, "The Key password cannot be null"); checkArgument(getKeyStorePassword() != null, "The KeyStore password cannot be null"); checkArgument(getKeyManagerAlgorithm() != null, "The Key Manager Algorithm cannot be null"); } }
public CompositeOptionalObjectsController(OptionalObjectsController... controllers) { checkArgument(!ArrayUtils.isEmpty(controllers), "cannot compose empty controllers list"); this.controllers = ImmutableList.copyOf(controllers); }
public ProxyConfig build() { checkArgument(ntlmProxyConfig.getHost() != null, "Host must be not null"); checkArgument(ntlmProxyConfig.getPort() <= MAXIMUM_PORT_NUMBER, "Port was not configured or configured with a value greater than " + MAXIMUM_PORT_NUMBER); checkArgument(ntlmProxyConfig.getNtlmDomain() != null, "Ntlm domain must be not null"); return ntlmProxyConfig; }
/** * {@inheritDoc} */ @Override public <T> T deserialize(byte[] bytes, ClassLoader classLoader) throws SerializationException { checkArgument(bytes != null, "The byte[] must not be null"); return deserialize(new ByteArrayInputStream(bytes), classLoader); }
/** * @param port port to use for the listener * @return the builder */ public HttpListenerBuilder setPort(final int port) { Preconditions.checkArgument(port > 0 && port < MAXIMUM_PORT_NUMBER, "Port number out of range"); Preconditions.checkState(httpListenerConfig == null, "Listener config already specified. A port cannot be specified since the one in the listener config will be used"); Preconditions.checkState(this.port == null, "Port already specified"); this.port = port; return this; }
/** * {@inheritDoc} */ @Override public void registerNamespaces(NamespaceManager namespaceManager) { checkArgument(namespaceManager != null, "cannot register a null namespace manager"); registerNamespaces(namespaceManager.getNamespaces()); }
public ResponseCompletionHandler(final FilterChainContext ctx, final HttpRequestPacket httpRequestPacket, final HttpResponse httpResponse, ResponseStatusCallback responseStatusCallback) { Preconditions.checkArgument((!(httpResponse.getEntity() instanceof InputStreamHttpEntity)), "response entity cannot be input stream"); this.ctx = ctx; this.httpResponsePacket = buildHttpResponsePacket(httpRequestPacket, httpResponse); this.httpResponseContent = buildResponseContent(httpResponse); this.responseStatusCallback = responseStatusCallback; }