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

How to use
hashCode
method
in
java.lang.String

Best Java code snippets using java.lang.String.hashCode (Showing top 20 results out of 123,003)

origin: google/guava

 @Override
 public int hashCode() {
  return name.hashCode();
 }
}
origin: google/guava

 @Override
 public int hashCode() {
  return justAfterNull.hashCode();
 }
}
origin: spring-projects/spring-framework

@Override
public int hashCode() {
  int result = this.beanName.hashCode();
  result = 29 * result + (this.toParent ? 1 : 0);
  return result;
}
origin: spring-projects/spring-framework

@Override
public int hashCode() {
  int result = 27;
  for (String pattern : this.patterns) {
    result = 13 * result + pattern.hashCode();
  }
  for (String excludedPattern : this.excludedPatterns) {
    result = 13 * result + excludedPattern.hashCode();
  }
  return result;
}
origin: spring-projects/spring-framework

/**
 * This implementation returns the hash code of the underlying description String.
 */
@Override
public int hashCode() {
  return this.description.hashCode();
}
origin: spring-projects/spring-framework

/**
 * This implementation returns the hash code of the underlying
 * class path location.
 */
@Override
public int hashCode() {
  return this.path.hashCode();
}
origin: stackoverflow.com

final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
 final String tmDevice, tmSerial, androidId;
 tmDevice = "" + tm.getDeviceId();
 tmSerial = "" + tm.getSimSerialNumber();
 androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
 UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
 String deviceId = deviceUuid.toString();
origin: square/okhttp

@Override public int hashCode() {
 int result = 29;
 result = 31 * result + scheme.hashCode();
 result = 31 * result + authParams.hashCode();
 return result;
}
origin: square/okhttp

@Override public int hashCode() {
 int result = 17;
 result = 31 * result + pattern.hashCode();
 result = 31 * result + hashAlgorithm.hashCode();
 result = 31 * result + hash.hashCode();
 return result;
}
origin: spring-projects/spring-framework

@Override
public int hashCode() {
 return name.hashCode()
   ^ Integer.rotateLeft(descriptor.hashCode(), 8)
   ^ Integer.rotateLeft(bootstrapMethod.hashCode(), 16)
   ^ Integer.rotateLeft(Arrays.hashCode(bootstrapMethodArguments), 24);
}
origin: spring-projects/spring-framework

/**
 * This implementation returns {@code toString()}'s hash code.
 * @see #toString()
 */
@Override
public int hashCode() {
  return toString().hashCode();
}
origin: spring-projects/spring-framework

@Override
public int hashCode() {
  int hashCode = this.beanDefinition.hashCode();
  hashCode = 29 * hashCode + this.beanName.hashCode();
  hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(this.aliases);
  return hashCode;
}
origin: spring-projects/spring-framework

  @Override
  public int hashCode() {
    int result = this.foo.hashCode();
    result = 31 * result + this.bar.hashCode();
    return result;
  }
}
origin: spring-projects/spring-framework

/**
 * Generate a unique hash code for all properties of this
 * {@code WebMergedContextConfiguration} excluding the
 * {@linkplain #getTestClass() test class}.
 */
@Override
public int hashCode() {
  return super.hashCode() * 31 + this.resourceBasePath.hashCode();
}
origin: ReactiveX/RxJava

@Override
public Integer apply(Integer t1) {
  // be slow ... but faster than Thread.sleep(1)
  String t = "";
  int s = sink;
  for (int i = 2000; i >= 0; i--) {
    t = String.valueOf(i + t.hashCode() + s);
  }
  sink = t.hashCode();
  return t1;
}
origin: google/guava

@Override
public int hashCode() {
 onHashCode.run();
 return delegateString.hashCode();
}
origin: google/guava

@Override
public int hashCode() {
 onHashCode.run();
 return delegateString.hashCode();
}
origin: google/guava

@Override
public int hashCode() {
 onHashCode.run();
 return delegateString.hashCode();
}
origin: google/guava

@Override
public int hashCode() {
 onHashCode.run();
 return delegateString.hashCode();
}
origin: spring-projects/spring-framework

@Test
public void nullSafeHashCodeWithObjectArray() {
  int expected = 31 * 7 + "Leia".hashCode();
  expected = 31 * expected + "Han".hashCode();
  Object[] array = {"Leia", "Han"};
  int actual = ObjectUtils.nullSafeHashCode(array);
  assertEquals(expected, actual);
}
java.langStringhashCode

Javadoc

Returns a hash code for this string. The hash code for a String object is computed as
 
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] 
using int arithmetic, where s[i] is the ith character of the string, n is the length of the string, and ^ indicates exponentiation. (The hash value of the empty string is zero.)

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>,
  • equalsIgnoreCase,
  • replace,
  • isEmpty,
  • charAt,
  • 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 Vim plugins
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