Java Code Examples for java.io.Serializable#hashCode()

The following examples show how to use java.io.Serializable#hashCode() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public int hashCode()
{
    int h = 0;
    if (actualType != null)
        h = actualType.hashCode();
    Serializable persistedValue = getPersistedValue();
    if (persistedValue != null)
        h += 17 * persistedValue.hashCode();
    return h;
}
 
Example 2
void first() {
    ClassHoldingDependencies instanceOne = new ClassHoldingDependencies();
    Object someOtherObject = new Object();
    Serializable someSerializable = new Serializable() {
    };
    instanceOne.setSomeInt(1);
    someOtherObject.toString();
    someSerializable.hashCode();
    instanceOne.someInt = 5;
}
 
Example 3
public static int nextHashCode( final int previousHash, final Serializable attr ) {
	if ( attr == null ) {
		return previousHash;
	}
	return previousHash + attr.hashCode() ^ 31;
}
 
Example 4
public CacheRegionKey(String cacheRegion, Serializable cacheKey)
{
    this.cacheRegion = cacheRegion;
    this.cacheKey = cacheKey;
    this.hashCode = cacheRegion.hashCode() + cacheKey.hashCode();
}
 
Example 5
public CacheRegionKey(String cacheRegion, Serializable cacheKey)
{
    this.cacheRegion = cacheRegion;
    this.cacheKey = cacheKey;
    this.hashCode = cacheRegion.hashCode() + cacheKey.hashCode();
}
 
Example 6
public CacheRegionValueKey(String cacheRegion, Serializable cacheValueKey)
{
    this.cacheRegion = cacheRegion;
    this.cacheValueKey = cacheValueKey;
    this.hashCode = cacheRegion.hashCode() + cacheValueKey.hashCode();
}