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

The following are Jave code examples for showing how to use hashCode() of the java.io.Serializable class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: alfresco-repository   File: NodePropertyValue.java   View Source Code Vote up 5 votes
@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
Project: ArchUnit   File: FirstClassWithDependency.java   View Source Code Vote up 5 votes
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
Project: alfresco-repository   File: TransactionalCache.java   View Source Code Vote up 4 votes
public CacheRegionKey(String cacheRegion, Serializable cacheKey)
{
    this.cacheRegion = cacheRegion;
    this.cacheKey = cacheKey;
    this.hashCode = cacheRegion.hashCode() + cacheKey.hashCode();
}
 
Example 4
Project: alfresco-repository   File: CacheRegionKey.java   View Source Code Vote up 4 votes
public CacheRegionKey(String cacheRegion, Serializable cacheKey)
{
    this.cacheRegion = cacheRegion;
    this.cacheKey = cacheKey;
    this.hashCode = cacheRegion.hashCode() + cacheKey.hashCode();
}
 
Example 5
Project: alfresco-repository   File: CacheRegionValueKey.java   View Source Code Vote up 4 votes
public CacheRegionValueKey(String cacheRegion, Serializable cacheValueKey)
{
    this.cacheRegion = cacheRegion;
    this.cacheValueKey = cacheValueKey;
    this.hashCode = cacheRegion.hashCode() + cacheValueKey.hashCode();
}