public String getOfflineText() { if (!StringUtils.isNotEmpty(offlineText)) { return ""; } return offlineText; }
public String getSubject() { if (!StringUtils.isNotEmpty(subject)) { return ""; } return subject; }
public String getEmailAddress() { if (!StringUtils.isNotEmpty(emailAddress)) { return ""; } return emailAddress; }
/** * The 'datatype' attribute specifies the datatype. This attribute is OPTIONAL, and when not specified, defaults to * "xs:string". * * @param datatype the data type of any value contained within the {@link FormField} element. */ private ValidateElement(String datatype) { this.datatype = StringUtils.isNotEmpty(datatype) ? datatype : null; }
public String getRedirectURL() { if (!StringUtils.isNotEmpty(redirectURL)) { return ""; } return redirectURL; }
/** * Returns true if all given CharSequences are either null or empty. * * @param css the CharSequences to test. * @return true if all given CharSequences are null or empty. */ public static boolean isNullOrEmpty(CharSequence... css) { for (CharSequence cs : css) { if (StringUtils.isNotEmpty(cs)) { return false; } } return true; }
private String getGS2Header() { String authzidPortion = ""; if (authorizationId != null) { authzidPortion = "a=" + authorizationId; } String cbName = getChannelBindingName(); assert (StringUtils.isNotEmpty(cbName)); return cbName + ',' + authzidPortion + ","; }
private void setContentBinaryIfRequired() { if (contentBinary == null) { assert (StringUtils.isNotEmpty(contentString)); contentBinary = Base64.decode(contentString); } }
public boolean isConfigured() { return StringUtils.isNotEmpty(getEmailAddress()) && StringUtils.isNotEmpty(getSubject()) && StringUtils.isNotEmpty(getOfflineText()); }
public boolean isSearchEnabled() { return StringUtils.isNotEmpty(getForumsLocation()) && StringUtils.isNotEmpty(getKbLocation()); }
@Override protected boolean acceptSpecific(Message message) { return StringUtils.isNotEmpty(message.getThread()); }
/** * Create a new SpoilerElement with a hint about a content and a language attribute. * * @param language language of the hint. * @param hint hint about the content. */ public SpoilerElement(String language, String hint) { if (StringUtils.isNotEmpty(language) && StringUtils.isNullOrEmpty(hint)) { throw new IllegalArgumentException("Hint cannot be null or empty if language is not empty."); } this.language = language; this.hint = hint; }
public boolean redirects() { return (StringUtils.isNotEmpty(getRedirectURL())); }
public boolean hasKB() { return StringUtils.isNotEmpty(getKbLocation()); }
public boolean hasForums() { return StringUtils.isNotEmpty(getForumsLocation()); }
@Override public SignElement parse(XmlPullParser parser, int initialDepth) throws Exception { OpenPgpContentElementData data = parseOpenPgpContentElementData(parser, initialDepth); if (StringUtils.isNotEmpty(data.rpad)) { LOGGER.warning("Ignoring rpad in XEP-0373 <sign/> element"); } return new SignElement(data.to, data.timestamp, data.payload); }
public XmlStringBuilder halfOpenElement(String name) { assert (StringUtils.isNotEmpty(name)); sb.append('<').append(name); return this; }
@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { buf.append('>'); if (StringUtils.isNotEmpty(getQuery())) { buf.append("<query>" + getQuery() + "</query>"); } return buf; }
@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { if (StringUtils.isNotEmpty(getJid())) { buf.append("jid=\"" + getJid() + "\" "); } buf.setEmptyElement(); return buf; }
@Test public void testIqId() { IQ iq1 = new TestIQ(); String iq1Id = iq1.getStanzaId(); assertTrue(StringUtils.isNotEmpty(iq1Id)); IQ iq2 = new TestIQ(); String iq2Id = iq2.getStanzaId(); assertTrue(StringUtils.isNotEmpty(iq2Id)); assertFalse(iq1Id.equals(iq2Id)); }