title: Create hash from string and int
body: <p>I remember eclipse and idea have this template to automatically create an object's hashCode based on its attributes.</p>
  
  <p>One of the strategies if a number and a string is used is something like this.</p>
  
  <pre><code>  return stringValue.hashCode() + intValue * 32;
  </code></pre>
  
  <p>Ooor something like that.</p>
  
  <p>I don't have nor eclipse or idea at hand and I would like to create such function. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Based on the answers I create this mini-class</p>
  
  <pre><code>    class StringInt {
          private final String s;
          private final int i;
  
          static StringInt valueOf( String string , int value ) {
              return new StringInt( string, value );
          }
          private StringInt( String string, int value ) {
              this.s = string;
              this.i = value;
          }
          public boolean equals( Object o ) {
              if( o != null &amp;&amp; o instanceof StringInt ){
                  StringInt other = ( StringInt ) o;
                  return this.s == other.s &amp;&amp; this.i == other.i;
              }
  
              return false;
          }
          public int hashCode() {
              return s != null ? s.hashCode() * 37 + i : i;
          }
      }
  </code></pre>
  
  <p>This class is to be used as key for a large memory map ( > 10k elements ) I don't want to iterate them each time to find if the String and the int are the same. </p>
  
  <p>Thank you.</p>
  
  <p>ps.. mmh probably it should be names StringIntKey.</p>