return str; if (startsWithIgnoreCase(str, remove)) { return str.substring(remove.length());
@Override public Boolean evaluate(FunctionArgs args, EvaluationContext context) { final String value = valueParam.required(args, context); final String prefix = prefixParam.required(args, context); final boolean ignoreCase = ignoreCaseParam.optional(args, context).orElse(false); if (ignoreCase) { return StringUtils.startsWithIgnoreCase(value, prefix); } else { return StringUtils.startsWith(value, prefix); } }
private Closure tryToFindMatchingEncoder(String contentType) { final Closure closure; if (contentType == null) { closure = null; } else if (StringUtils.startsWithIgnoreCase(contentType, "text/") || StringUtils.containsIgnoreCase(contentType, "+text")) { closure = new MethodClosure(this, "encodeText"); } else { closure = null; } return closure; }
/** * Test StringUtils.testStartsWithIgnoreCase() */ @Test public void testStartsWithIgnoreCase() { assertTrue("startsWithIgnoreCase(null, null)", StringUtils.startsWithIgnoreCase(null, null)); assertFalse("startsWithIgnoreCase(FOOBAR, null)", StringUtils.startsWithIgnoreCase(FOOBAR, null)); assertFalse("startsWithIgnoreCase(null, FOO)", StringUtils.startsWithIgnoreCase(null, FOO)); assertTrue("startsWithIgnoreCase(FOOBAR, \"\")", StringUtils.startsWithIgnoreCase(FOOBAR, "")); assertTrue("startsWithIgnoreCase(foobar, foo)", StringUtils.startsWithIgnoreCase(foobar, foo)); assertTrue("startsWithIgnoreCase(FOOBAR, FOO)", StringUtils.startsWithIgnoreCase(FOOBAR, FOO)); assertTrue("startsWithIgnoreCase(foobar, FOO)", StringUtils.startsWithIgnoreCase(foobar, FOO)); assertTrue("startsWithIgnoreCase(FOOBAR, foo)", StringUtils.startsWithIgnoreCase(FOOBAR, foo)); assertFalse("startsWithIgnoreCase(foo, foobar)", StringUtils.startsWithIgnoreCase(foo, foobar)); assertFalse("startsWithIgnoreCase(foo, foobar)", StringUtils.startsWithIgnoreCase(bar, foobar)); assertFalse("startsWithIgnoreCase(foobar, bar)", StringUtils.startsWithIgnoreCase(foobar, bar)); assertFalse("startsWithIgnoreCase(FOOBAR, BAR)", StringUtils.startsWithIgnoreCase(FOOBAR, BAR)); assertFalse("startsWithIgnoreCase(foobar, BAR)", StringUtils.startsWithIgnoreCase(foobar, BAR)); assertFalse("startsWithIgnoreCase(FOOBAR, bar)", StringUtils.startsWithIgnoreCase(FOOBAR, bar)); }
if (StringUtils.startsWithIgnoreCase(field.getType(), "map")) { continue;
private Closure tryToFindMatchingEncoder(String contentType) { final Closure closure; if (contentType == null) { closure = null; } else if (StringUtils.startsWithIgnoreCase(contentType, "text/") || StringUtils.containsIgnoreCase(contentType, "+text")) { closure = new MethodClosure(this, "encodeText"); } else { closure = null; } return closure; }
/** * Returns a new instance of a connection from an uri. The uri should be start with a protocol * {@link ConnectionDriver#getProtocol()} that defines which driver to use. The driver may then * have different styles for defining paths, ex: jserialcomm://{portname}:{baudrate} * * @param uri the uri for the hardware to connect to * @return a connection * @throws ConnectionException if something went wron while creating the connection */ static public Connection getConnection(String uri) throws ConnectionException{ for (ConnectionDriver connectionDriver : ConnectionDriver.values()) { if (StringUtils.startsWithIgnoreCase(uri, connectionDriver.getProtocol())) { Connection connection = getConnection(connectionDriver).orElseThrow(() -> new ConnectionException("Couldn't load connection driver " + connectionDriver + " for uri: " + uri)); connection.setUri(uri); return connection; } } throw new ConnectionException("Couldn't find connection driver for uri: " + uri); }
/** * Is the main identifier a SAML account. * @return true if user is signed in with a SAML account */ @JsonIgnore public boolean isSAMLUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.SAML_PREFIX); }
/** * Is the main identifier a Facebook id * @return true if user is signed in with Facebook */ @JsonIgnore public boolean isFacebookUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.FB_PREFIX); }
/** * Is the main identifier a LinkedIn id * @return true if user is signed in with LinkedIn */ @JsonIgnore public boolean isLinkedInUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.LINKEDIN_PREFIX); }
/** * Is the main identifier a Facebook id. * @return true if user is signed in with Facebook */ @JsonIgnore public boolean isFacebookUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.FB_PREFIX); }
/** * Is the main identifier a Twitter id. * @return true if user is signed in with Twitter */ @JsonIgnore public boolean isTwitterUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.TWITTER_PREFIX); }
/** * Is the main identifier a GitHub id. * @return true if user is signed in with GitHub */ @JsonIgnore public boolean isGitHubUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.GITHUB_PREFIX); }
/** * Is the main identifier a LDAP account. * @return true if user is signed in with a LDAP account */ @JsonIgnore public boolean isLDAPUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.LDAP_PREFIX); }
/** * Is the main identifier a Google+ id. * @return true if user is signed in with Google+ */ @JsonIgnore public boolean isGooglePlusUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.GPLUS_PREFIX); }
/** * Is the main identifier a LinkedIn id. * @return true if user is signed in with LinkedIn */ @JsonIgnore public boolean isLinkedInUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.LINKEDIN_PREFIX); }
/** * Is the main identifier a Microsoft/Windows account id. * @return true if user is signed in with a Microsoft account */ @JsonIgnore public boolean isMicrosoftUser() { return StringUtils.startsWithIgnoreCase(identifier, Config.MICROSOFT_PREFIX); }
public boolean isStandardSpring() { return StringUtils.startsWithIgnoreCase( getName(), "org.springframework." ); } }
@Override public void setJndiLocation(String jndiLocation) { if (StringUtils.isNotBlank(jndiLocation) && !StringUtils.startsWithIgnoreCase(jndiLocation, JNDI_JAVA_SCHEME)) { throw new IllegalArgumentException("Only the java URL scheme(java:) is allowed for the jndiLocation"); } this.jndiLocation = jndiLocation; propertyChanged(); }
@Override public AuthorityValue getAuthorityValueType(String metadataString) { AuthorityValue fromAuthority = null; for (AuthorityValue type : authorityTypes.getTypes()) { if (StringUtils.startsWithIgnoreCase(metadataString, type.getAuthorityType())) { fromAuthority = type; } } return fromAuthority; }