List of usage examples for org.apache.commons.lang3 Validate notEmpty
public static <T extends CharSequence> T notEmpty(final T chars)
Validate that the specified argument character sequence is neither null nor a length of zero (no characters); otherwise throwing an exception with the specified message.
From source file:com.vmware.identity.openidconnect.server.ScopeValue.java
public static boolean isDefined(String scopeValueName) { Validate.notEmpty(scopeValueName); boolean isDefined = false; for (ScopeValue scopeValue : ScopeValue.values()) { if (scopeValue.getName().equals(scopeValueName)) { isDefined = true;//from w w w. j av a 2s.c o m break; } } return isDefined; }
From source file:co.runrightfast.commons.utils.ValidationUtils.java
static void notEmpty(final Collection<?> coll) { Validate.notEmpty(coll); }
From source file:com.chiorichan.factory.parsers.BasicParser.java
public BasicParser(String patternOne, String patternTwo) { Validate.notEmpty(patternOne); Validate.notEmpty(patternTwo); p1 = Pattern.compile(patternOne); p2 = Pattern.compile(patternTwo); }
From source file:de.micromata.genome.gwiki.wicket.util.GWikiUtils.java
/** * Retrieves a given GWiki page, or, if not null, a GWiki part, or, if not null, a GWiki chunk. Will cause an exception if no page with * the given id is found./* w w w.j a v a 2s . c o m*/ * * @param pageId GWiki page id, may not be null or empty * @param partName part name, may be null * @param chunk chunk name, may be null * @return GWiki page or part or chunk */ public static String getWikiPage(String pageId, String partName, String chunk) { Validate.notEmpty(pageId); GWikiWeb wikiWeb = GWikiWeb.getWiki(); GWikiElement el = wikiWeb.getElement(pageId); GWikiStandaloneContext wikiContext = GWikiStandaloneContext.create(); if (partName != null) { wikiContext.setRequestAttribute(GWikiWikiPage.REQUESTATTR_GWIKIPART, partName); } if (chunk != null) { wikiContext.setRequestAttribute(GWikiChunkMacro.REQUESTATTR_GWIKICHUNK, chunk); } try { GWikiContext.setCurrent(wikiContext); el.serve(wikiContext); String sout = wikiContext.getOutString(); return sout; } finally { GWikiContext.setCurrent(null); } }
From source file:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_browser.AbstractSignBrowserTest.java
public static Matcher<RecyclerView.ViewHolder> getHolderForSignWithName(final String signNameLocaleDe) { Validate.notEmpty(signNameLocaleDe); return new BaseMatcher<RecyclerView.ViewHolder>() { @Override//from ww w . j a va 2 s .com public boolean matches(Object item) { Validate.isInstanceOf(SignBrowserAdapter.ViewHolder.class, item); final SignBrowserAdapter.ViewHolder holder = (SignBrowserAdapter.ViewHolder) item; boolean matches = false; if (!(null == holder.txtSignName)) { matches = ((signNameLocaleDe.equals(holder.txtSignName.getText().toString())) && (View.VISIBLE == holder.txtSignName.getVisibility())); } return matches; } @Override public void describeTo(Description description) { description.appendText("with sign name: " + signNameLocaleDe); } }; }
From source file:com.nortal.petit.converter.DateToStringConverter.java
public DateToStringConverter(String dateFormat) { super(Date.class); Validate.notEmpty(dateFormat); this.dateFormat = dateFormat; }
From source file:de.weltraumschaf.groundzero.model.CheckstyleSeverity.java
/** * Initializes the {@link #name textual representation}. * * @param name must not be {@code null} nor empty. *///w ww .j av a 2s . c o m private CheckstyleSeverity(final String name) { Validate.notEmpty(name); this.name = name; }
From source file:com.nortal.petit.converter.StringToDateConverter.java
public StringToDateConverter(String dateFormat) { super(Date.class); Validate.notEmpty(dateFormat); this.dateFormat = dateFormat; }
From source file:de.weltraumschaf.groundzero.model.CheckstyleFile.java
/** * Dedicated constructor./*from ww w . j a v a 2s . c om*/ * * @param fileName must not be {@code null} or empty. */ public CheckstyleFile(final String fileName) { super(); Validate.notEmpty(fileName); this.fileName = fileName; }
From source file:com.thinkbiganalytics.util.PartitionKey.java
public PartitionKey(String key, String type, String formula) { Validate.notEmpty(key); Validate.notEmpty(type);//from ww w .j a v a2 s .c om Validate.notEmpty(formula); this.key = key.trim().toLowerCase(); this.type = type.trim().toLowerCase(); this.formula = formula.trim().toLowerCase(); }