Example usage for java.util UUID hashCode

List of usage examples for java.util UUID hashCode

Introduction

In this page you can find the example usage for java.util UUID hashCode.

Prototype

public int hashCode() 

Source Link

Document

Returns a hash code for this UUID .

Usage

From source file:Main.java

public static void main(String[] args) {
    // creating UUID      
    UUID uid = UUID.randomUUID();

    // checking hash code value
    System.out.println("Hash code value: " + uid.hashCode());
}

From source file:org.jasig.ssp.model.AbstractAuditable.java

protected final int hashField(final String name, final UUID value) {
    return (value == null ? name.hashCode() : value.hashCode());
}

From source file:org.plasma.sdo.core.CoreDataObject.java

/**
 * Resets the UUID after creation for cases where the UUID
 * is stored externally and services creating data objects
 * need to preserve the stored UUIDs across service calls.
 * Refreshes the integral hash and other elements dependent
 * on the cached UUID. //w w  w.  jav  a 2  s .com
 * @param uuid the UUID
 */
public void resetUUID(UUID uuid) {
    this.uuid = uuid;
    this.hashCode = uuid.hashCode();
}