List of usage examples for org.springframework.util Assert hasText
public static void hasText(@Nullable String text, Supplier<String> messageSupplier)
From source file:cat.albirar.framework.sets.registry.impl.SetRegistryDefaultImpl.java
/** * {@inheritDoc}//from www . ja v a 2s . co m */ @Override public boolean containsSet(String setName) { Assert.hasText(setName, "The setName are required and cannot be empty or only whitespace!"); return registry.containsKey(setName); }
From source file:org.esco.portlet.changeetab.dao.impl.MockUserDao.java
@Override public void afterPropertiesSet() throws Exception { Assert.hasText(this.userDn, "No user dn configured !"); Assert.hasText(this.userIdTemplate, "No user Id template configured !"); Assert.hasText(this.currentEtabIdLdapKey, "No current etab Id Ldap key configured !"); Assert.state(this.userDn.contains(this.userIdTemplate), "User dn doesn't contain the user Id template !"); }
From source file:org.cleverbus.core.common.ws.transport.http.ntlm.NtlmCloseableHttpComponentsMessageSender.java
/** * Create a new instance of the {@code HttpClientMessageSender} with a default {@link HttpClient} * with added support for NTLM.//from w w w . j ava 2s. co m * * @param ntlmUsername the NTLM username (without domain name) * @param ntlmPassword the NTLM password * @param ntlmDomain the NTLM domain */ public NtlmCloseableHttpComponentsMessageSender(String ntlmUsername, String ntlmPassword, String ntlmDomain) { super(); Assert.hasText(ntlmUsername, "the ntlmUsername must not be empty"); Assert.hasText(ntlmPassword, "the ntlmPassword must not be empty"); Assert.hasText(ntlmDomain, "the ntlmDomain must not be empty"); this.ntlmUsername = ntlmUsername; this.ntlmPassword = ntlmPassword; this.ntlmDomain = ntlmDomain; // Register NTLMSchemeFactory with the HttpClient instance you want to NTLM enable. Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create() .register(AuthSchemes.NTLM, new NTLMSchemeFactory()).build(); getClientBuilder().setDefaultAuthSchemeRegistry(authSchemeRegistry); NTCredentials credentials = new NTCredentials(ntlmUsername, ntlmPassword, MACHINE_NAME, ntlmDomain); CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); setCredentials(credentials); credentialsProvider.setCredentials(AuthScope.ANY, credentials); // register NTLM to HttpClient setCredentialsProvider(credentialsProvider); }
From source file:fr.mby.utils.spring.beans.factory.ProxywiredMethodParam.java
public ProxywiredMethodParam(final String nodePath) { super();/*from w ww . j av a 2 s. c o m*/ Assert.hasText(nodePath, "No nodePath provided !"); this.nodePath = nodePath; }
From source file:io.galeb.core.entity.Account.java
public Account setEmail(String email) { Assert.hasText(email, "[Assertion failed] - this String argument must have text; it must not be null, empty, or blank"); updateHash();// w ww. j ava2s .c om this.email = email; return this; }
From source file:cn.geobeans.web.common.utils.ReflectionUtils.java
/** * ?, ?DeclaredField, ?.// w ww . jav a2 s .c o m * * ?Object?, null. */ public static Field getAccessibleField(final Object obj, final String fieldName) { Assert.notNull(obj, "object?"); Assert.hasText(fieldName, "fieldName"); for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass .getSuperclass()) { try { Field field = superClass.getDeclaredField(fieldName); field.setAccessible(true); return field; } catch (NoSuchFieldException e) {//NOSONAR // Field??,? } } return null; }
From source file:oz.hadoop.yarn.api.YarnAssembly.java
/** * Factory method which allows one to define specification for Command-based (e.g., unix, perl etc) Yarn Application * which executes as a task implemented by a provided {@link ApplicationContainerProcessor} class using input arguments * as {@link ByteBuffer} and exiting upon completion. * <br>// www. jav a2 s.c om * Semantically this factory method is quite different then the factory method which takes {@link ApplicationContainerProcessor} without * any input arguments, resulting in managed and interactable Application Containers. See its javadoc for more explanation. */ public static WithVcPrMemCount<Void> forApplicationContainer(String command) { Assert.hasText(command, "'command' must not be null or empty"); return createV(command, null, null, null); }
From source file:com.autentia.wuija.trace.Tracer.java
public Tracer(String applicationName, Map<String, List<TraceProcessor>> traceProcessors) { Assert.hasText(applicationName, "application cannot be empty"); Assert.notEmpty(traceProcessors);//w w w . jav a 2 s.c o m this.application = applicationName; processorsCache.putAll(traceProcessors); }
From source file:net.tzolov.geode.archive.loader.AbstractStatisticsTSDBLoader.java
/** * @param cleanDatabaseOnLoad If true the target TSDB is created or recreate. * @param archiveFile The Apache Geode (GemFire) statistics archive file * @param geodeMemberName Unique name used to distinct the statistics in this * @param allowStatTypes List of Statistic Type Names to import. If empty all statistic is imported *///from ww w . ja va 2s . c o m public AbstractStatisticsTSDBLoader(boolean cleanDatabaseOnLoad, File archiveFile, String geodeMemberName, String[] allowStatTypes) { Assert.notNull(archiveFile, "Not null archiveFile is required!"); Assert.hasText(geodeMemberName, "Not empty geodeMemberName is required!"); this.archiveFileName = archiveFile; this.geodeMemberName = geodeMemberName; this.cleanDatabaseOnLoad = cleanDatabaseOnLoad; if (allowStatTypes != null && allowStatTypes.length > 0) { statFilters = new ValueFilter[] { new StatFilter(allowStatTypes) }; } }