@Test public void testIsAllBlank() { assertTrue(StringUtils.isAllBlank((String) null)); assertTrue(StringUtils.isAllBlank((String[]) null)); assertTrue(StringUtils.isAllBlank(null, null)); assertTrue(StringUtils.isAllBlank(null, " ")); assertFalse(StringUtils.isAllBlank(null, "foo")); assertFalse(StringUtils.isAllBlank("", "bar")); assertFalse(StringUtils.isAllBlank("bob", "")); assertFalse(StringUtils.isAllBlank(" bob ", null)); assertFalse(StringUtils.isAllBlank(" ", "bar")); assertFalse(StringUtils.isAllBlank("foo", "bar")); }
public boolean hasValues() { return !isAllBlank(getCode(), getDisplay()); }
public boolean hasValues() { return !isAllBlank(getSource(), getSourceVersion(), getTarget(), getTargetVersion()); }
public boolean hasValues() { return !isAllBlank(getCode(), getDisplay(), getEquivalence(), getComment()); }
public boolean isEmpty() { return StringUtils.isAllBlank(id, name); } }
public boolean isBlank() { return StringUtils.isAllBlank(username, password); }
private void setConfigurationParameter(ConfigurationParameter parameter, String... value) { if (StringUtils.isAllBlank(value)) { LOGGER.debug("Parameter <{}> has blank value, hence will not be registered", parameter); return; } LOGGER.debug("Setting parameter <{}> to <{}>", parameter, value); this.registry.put(parameter, Arrays.asList(value)); }
/** * Given a {@link JSONObject} containing data for an external identifier, returns a {@link Pair} connecting a label * and its corresponding value. * * @param identifierJSON the {@link JSONObject} containing identifier information * @return a {@link Pair} with the label on the left (key) and the value on the right (value), either of which may * be blank, but not both; if both the label and the value are empty, {@code null} is returned */ private Pair<String, String> toIdentifier(@Nonnull final JSONObject identifierJSON) { String label = identifierJSON.optString(INTERNAL_LABEL_KEY); String value = identifierJSON.optString(INTERNAL_VALUE_KEY); if (StringUtils.isAllBlank(label, value)) { return null; } return Pair.of(label, value); }
/** * Takes a {@link Pair} containing identifier data, and returns this data as a {@link JSONObject}. * * @param identifier a {@link Pair} containing information for an external identifier * @return external identifier data as {@link JSONObject} */ private JSONObject toJSON(@Nonnull final Pair<String, String> identifier) { if (StringUtils.isAllBlank(identifier.getKey(), identifier.getValue())) { return null; } final JSONObject identifierJSON = new JSONObject(); identifierJSON.put(INTERNAL_LABEL_KEY, identifier.getKey()); identifierJSON.put(INTERNAL_VALUE_KEY, identifier.getValue()); return identifierJSON; }
/** * Takes a {@link BaseObject} of {@code LabeledIdentifierClass} and returns a {@link Pair} connecting a label and * its corresponding value. * * @param identifierObject the XWiki {@link BaseObject} of {@code LabeledIdentifierClass} * @return a {@link Pair} with the label on the left (key) and the value on the right (value), either of which may * be blank, but not both; if both the label and the value are empty, {@code null} is returned */ private Pair<String, String> toIdentifier(@Nonnull final BaseObject identifierObject) { String label = identifierObject.getStringValue(INTERNAL_LABEL_KEY); String value = identifierObject.getStringValue(INTERNAL_VALUE_KEY); if (StringUtils.isAllBlank(label, value)) { return null; } return Pair.of(label, value); }
@Override protected void validate(final BuilderStatus builderStatus) { if (StringUtils.isAnyBlank(username, password) && !StringUtils.isAllBlank(username, password)) { builderStatus.addErrorMessage("The username and password must both be populated or both be empty."); } }
private String describe() { if (StringUtils.isAllBlank(containerShortId, builder.name(), builder.imageName())) { return super.toString(); } return (StringUtils.isNotBlank(builder.name()) ? String.format("'%s' ", builder.name()) : "") + (StringUtils.isNotBlank(containerShortId) ? containerShortId + " " : "") + builder.imageName(); }
if (!StringUtils.isAllBlank(projectName, projectVersionName) && (StringUtils.isBlank(projectName) || StringUtils.isBlank(projectVersionName))) { errorMessages.add("Both projectName and projectVersionName must be provided or omitted together");
String metaServiceHost = properties.getProperty("meta.service.host", null); if (StringUtils.isAllBlank(metaServiceIp, metaServiceHost)) { throw new IllegalArgumentException("meta.service.ip and meta.service.host cannot be all null");
@Override public void initialize(KeyValueStoreDescriptor descriptor) { super.initialize(descriptor); logger = new JDBCLogger(name); Map<String, String> properties = descriptor.properties; dataSourceName = properties.get(DATASOURCE_PROP); if (StringUtils.isAllBlank(dataSourceName)) { throw new NuxeoException("Missing " + DATASOURCE_PROP + " property in configuration"); } String tableProp = properties.get(TABLE_PROP); String namespace = descriptor.namespace; String tbl; if (isBlank(tableProp)) { tbl = defaultIfBlank(namespace, name).trim(); } else if (isBlank(namespace)) { tbl = tableProp.trim(); } else { tbl = tableProp.trim() + "_" + namespace.trim(); } // check connection, get dialect and create table if needed runWithConnection(connection -> { dialect = Dialect.createDialect(connection, null); getTable(connection, tbl); }); prepareSQL(); startTTLThread(); }
public synchronized BasicMeta.Endpoint getMetaServiceEndpoint() { if (metaServiceEndpoint == null) { try { BasicMeta.Endpoint.Builder builder = BasicMeta.Endpoint.newBuilder(); Properties properties = serverConf.getProperties(); String metaServiceIp = properties.getProperty("meta.service.ip", null); String metaServiceHost = properties.getProperty("meta.service.host", null); if (StringUtils.isAllBlank(metaServiceIp, metaServiceHost)) { throw new IllegalArgumentException("meta.service.ip and meta.service.host cannot be all null"); } if (StringUtils.isNotBlank(metaServiceIp)) { builder.setIp(metaServiceIp); } if (StringUtils.isNotBlank(metaServiceHost)) { builder.setHostname(metaServiceHost); } String metaServicePort = properties.getProperty("meta.service.port", null); if (StringUtils.isNotBlank(metaServicePort)) { builder.setPort(Integer.valueOf(metaServicePort)); } else { throw new IllegalArgumentException("meta.service.port cannot be null"); } metaServiceEndpoint = builder.build(); } catch (Exception e) { LOGGER.info("[ROLL][INIT] init meta-service endpoint failed. using default"); metaServiceEndpoint = RuntimeConstants.getLocalEndpoint(8590); } } return metaServiceEndpoint; }
@Override protected void validate(final BuilderStatus builderStatus) { final ProxyInfo tempInfo = buildWithoutValidation(); if (!tempInfo.isBlank()) { if (StringUtils.isBlank(host) || port <= 0) { builderStatus.addErrorMessage("The proxy host must be specified and the port must be greater than zero."); } if (!StringUtils.isAllBlank(ntlmDomain, ntlmWorkstation) && (null == credentials || credentials.isBlank())) { builderStatus.addErrorMessage("Proxy username and password must be set for the NTLM proxy."); } } }
String hostname = callback.getHostname(); if (!StringUtils.isAllBlank(ip, hostname) && (routeNeighbours.contains(ip) || routeNeighbours.contains(hostname))) { result = callback;
/** * Sets the doctype setting * * @param inDoctype * The doctype to be set. If <code>doctype</code> is * <code>null</code> or a blank string, {@link HTMLAssertion#DEFAULT_DOCTYPE} will be * used */ public void setDoctype(String inDoctype) { if (StringUtils.isAllBlank(inDoctype)) { setProperty(new StringProperty(DOCTYPE_KEY, DEFAULT_DOCTYPE)); } else { setProperty(new StringProperty(DOCTYPE_KEY, inDoctype)); } }
|| (StringUtils.isBlank(originaObj.getUDynMembershipCond()) && StringUtils.isNotBlank(inner. getUDynMembershipCond())) || StringUtils.isAllBlank(originaObj.getUDynMembershipCond(), inner.getUDynMembershipCond()) || !inner.getUDynMembershipCond().equals(originaObj.getUDynMembershipCond()) || !CollectionUtils.diff(inner.getTypeExtensions(), originaObj.getTypeExtensions()).isEmpty();