Class HashCode$

java.lang.Object
org.apache.pekko.util.HashCode$

public class HashCode$ extends Object
Set of methods which allow easy implementation of hashCode.

Example:

  override def hashCode: Int = {
    var result = HashCode.SEED
    //collect the contributions of various fields
    result = HashCode.hash(result, fPrimitive)
    result = HashCode.hash(result, fObject)
    result = HashCode.hash(result, fArray)
    result
  }
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final HashCode$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    hash(int seed, boolean value)
     
    int
    hash(int seed, char value)
     
    int
    hash(int seed, double value)
     
    int
    hash(int seed, float value)
     
    int
    hash(int seed, int value)
     
    int
    hash(int seed, long value)
     
    int
    hash(int seed, Object any)
     
    int
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MODULE$

      public static final HashCode$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • HashCode$

      public HashCode$()
  • Method Details

    • SEED

      public int SEED()
    • hash

      public int hash(int seed, Object any)
    • hash

      public int hash(int seed, boolean value)
    • hash

      public int hash(int seed, char value)
    • hash

      public int hash(int seed, int value)
    • hash

      public int hash(int seed, long value)
    • hash

      public int hash(int seed, float value)
    • hash

      public int hash(int seed, double value)