Tabnine Logo
String.equalsIgnoreCase
Code IndexAdd Tabnine to your IDE (free)

How to use
equalsIgnoreCase
method
in
java.lang.String

Best Java code snippets using java.lang.String.equalsIgnoreCase (Showing top 20 results out of 147,870)

origin: square/okhttp

 /**
  * Returns true if {@code fieldName} is content specific and therefore should always be used
  * from cached headers.
  */
 static boolean isContentSpecificHeader(String fieldName) {
  return "Content-Length".equalsIgnoreCase(fieldName)
    || "Content-Encoding".equalsIgnoreCase(fieldName)
    || "Content-Type".equalsIgnoreCase(fieldName);
 }
}
origin: spring-projects/spring-framework

/**
 * Determine if the HTTP method is supported by browsers (i.e. GET or POST).
 */
protected boolean isMethodBrowserSupported(String method) {
  return ("get".equalsIgnoreCase(method) || "post".equalsIgnoreCase(method));
}
origin: spring-projects/spring-framework

/**
 * Return {@code true} if the {@link #setSecure secure} flag has been set
 * to {@code true} or if the {@link #getScheme scheme} is {@code https}.
 * @see javax.servlet.ServletRequest#isSecure()
 */
@Override
public boolean isSecure() {
  return (this.secure || HTTPS.equalsIgnoreCase(this.scheme));
}
origin: square/okhttp

private boolean isDotDot(String input) {
 return input.equals("..")
   || input.equalsIgnoreCase("%2e.")
   || input.equalsIgnoreCase(".%2e")
   || input.equalsIgnoreCase("%2e%2e");
}
origin: square/okhttp

private static @Nullable String get(String[] namesAndValues, String name) {
 for (int i = namesAndValues.length - 2; i >= 0; i -= 2) {
  if (name.equalsIgnoreCase(namesAndValues[i])) {
   return namesAndValues[i + 1];
  }
 }
 return null;
}
origin: square/okhttp

public Builder scheme(String scheme) {
 if (scheme == null) {
  throw new NullPointerException("scheme == null");
 } else if (scheme.equalsIgnoreCase("http")) {
  this.scheme = "http";
 } else if (scheme.equalsIgnoreCase("https")) {
  this.scheme = "https";
 } else {
  throw new IllegalArgumentException("unexpected scheme: " + scheme);
 }
 return this;
}
origin: spring-projects/spring-framework

public PathExtensionPredicate(String extension) {
  Assert.notNull(extension, "Extension must not be null");
  this.extensionPredicate = s -> {
    boolean match = extension.equalsIgnoreCase(s);
    traceMatch("Extension", extension, s, match);
    return match;
  };
  this.extension = extension;
}
origin: spring-projects/spring-framework

private static int getPort(URI uri) {
  int port = uri.getPort();
  if (port == -1) {
    if ("http".equalsIgnoreCase(uri.getScheme())) {
      port = 80;
    }
    else if ("https".equalsIgnoreCase(uri.getScheme())) {
      port = 443;
    }
  }
  return port;
}
origin: square/okhttp

 private static boolean bodyHasUnknownEncoding(Headers headers) {
  String contentEncoding = headers.get("Content-Encoding");
  return contentEncoding != null
    && !contentEncoding.equalsIgnoreCase("identity")
    && !contentEncoding.equalsIgnoreCase("gzip");
 }
}
origin: square/okhttp

/** Equivalent to {@code build().get(name)}, but potentially faster. */
public @Nullable String get(String name) {
 for (int i = namesAndValues.size() - 2; i >= 0; i -= 2) {
  if (name.equalsIgnoreCase(namesAndValues.get(i))) {
   return namesAndValues.get(i + 1);
  }
 }
 return null;
}
origin: square/okhttp

public Builder removeAll(String name) {
 for (int i = 0; i < namesAndValues.size(); i += 2) {
  if (name.equalsIgnoreCase(namesAndValues.get(i))) {
   namesAndValues.remove(i); // name
   namesAndValues.remove(i); // value
   i -= 2;
  }
 }
 return this;
}
origin: square/retrofit

void addHeader(String name, String value) {
 if ("Content-Type".equalsIgnoreCase(name)) {
  try {
   contentType = MediaType.get(value);
  } catch (IllegalArgumentException e) {
   throw new IllegalArgumentException("Malformed content type: " + value, e);
  }
 } else {
  requestBuilder.addHeader(name, value);
 }
}
origin: square/okhttp

/** Returns true if {@code certificate} matches {@code ipAddress}. */
private boolean verifyIpAddress(String ipAddress, X509Certificate certificate) {
 List<String> altNames = getSubjectAltNames(certificate, ALT_IPA_NAME);
 for (int i = 0, size = altNames.size(); i < size; i++) {
  if (ipAddress.equalsIgnoreCase(altNames.get(i))) {
   return true;
  }
 }
 return false;
}
origin: spring-projects/spring-framework

@Nullable
public Subscription getSubscription(String subscriptionId) {
  for (Map.Entry<String, Set<DefaultSubscriptionRegistry.Subscription>> destinationEntry :
      this.destinationLookup.entrySet()) {
    for (Subscription sub : destinationEntry.getValue()) {
      if (sub.getId().equalsIgnoreCase(subscriptionId)) {
        return sub;
      }
    }
  }
  return null;
}
origin: spring-projects/spring-framework

@Override
public boolean equals(@Nullable Object other) {
  if (this == other) {
    return true;
  }
  if (other == null || getClass() != other.getClass()) {
    return false;
  }
  AbstractNameValueExpression<?> that = (AbstractNameValueExpression<?>) other;
  return ((isCaseSensitiveName() ? this.name.equals(that.name) : this.name.equalsIgnoreCase(that.name)) &&
      ObjectUtils.nullSafeEquals(this.value, that.value) && this.isNegated == that.isNegated);
}
origin: spring-projects/spring-framework

@Override
public boolean equals(Object other) {
  if (this == other) {
    return true;
  }
  if (!(other instanceof HttpCookie)) {
    return false;
  }
  HttpCookie otherCookie = (HttpCookie) other;
  return (this.name.equalsIgnoreCase(otherCookie.getName()));
}
origin: spring-projects/spring-framework

private boolean isMultiple() throws JspException {
  Object multiple = getMultiple();
  if (multiple != null) {
    String stringValue = multiple.toString();
    return ("multiple".equalsIgnoreCase(stringValue) || Boolean.parseBoolean(stringValue));
  }
  return forceMultiple();
}
origin: spring-projects/spring-framework

private boolean peekIdentifierToken(String identifierString) {
  Token t = peekToken();
  if (t == null) {
    return false;
  }
  return (t.kind == TokenKind.IDENTIFIER && identifierString.equalsIgnoreCase(t.stringValue()));
}
origin: square/okhttp

@Override public Sink createRequestBody(Request request, long contentLength) {
 if ("chunked".equalsIgnoreCase(request.header("Transfer-Encoding"))) {
  // Stream a request body of unknown length.
  return newChunkedSink();
 }
 if (contentLength != -1) {
  // Stream a request body of a known length.
  return newFixedLengthSink(contentLength);
 }
 throw new IllegalStateException(
   "Cannot stream a request body without chunked encoding or a known content length!");
}
origin: google/guava

 @GwtIncompatible // String.toUpperCase() has browser semantics
 public void testEqualsIgnoreCaseUnicodeEquivalence() {
  // Note that it's possible in future that the JDK's idea to toUpperCase() or equalsIgnoreCase()
  // may change and break assumptions in this test [*]. This is not a bug in the implementation of
  // Ascii.equalsIgnoreCase(), but it is a signal that its documentation may need updating as
  // regards edge cases.

  // The Unicode point {@code 00df} is the lowercase form of sharp-S (ß), whose uppercase is "SS".
  assertEquals("PASSWORD", "pa\u00dfword".toUpperCase()); // [*]
  assertFalse("pa\u00dfword".equalsIgnoreCase("PASSWORD")); // [*]
  assertFalse(Ascii.equalsIgnoreCase("pa\u00dfword", "PASSWORD"));
 }
}
java.langStringequalsIgnoreCase

Javadoc

Compares the specified string to this string ignoring the case of the characters and returns true if they are equal.

Popular methods of String

  • equals
  • length
    Returns the number of characters in this string.
  • substring
    Returns a string containing a subsequence of characters from this string. The returned string shares
  • startsWith
    Compares the specified string to this string, starting at the specified offset, to determine if the
  • format
    Returns a formatted string, using the supplied format and arguments, localized to the given locale.
  • split
    Splits this string using the supplied regularExpression. See Pattern#split(CharSequence,int) for an
  • trim
  • valueOf
    Creates a new string containing the specified characters in the character array. Modifying the chara
  • indexOf
  • endsWith
    Compares the specified string to this string to determine if the specified string is a suffix.
  • toLowerCase
    Converts this string to lower case, using the rules of locale.Most case mappings are unaffected by t
  • contains
    Determines if this String contains the sequence of characters in the CharSequence passed.
  • toLowerCase,
  • contains,
  • getBytes,
  • <init>,
  • replace,
  • isEmpty,
  • charAt,
  • hashCode,
  • lastIndexOf

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now