Example usage for java.util UUID randomUUID

List of usage examples for java.util UUID randomUUID

Introduction

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

Prototype

public static UUID randomUUID() 

Source Link

Document

Static factory to retrieve a type 4 (pseudo randomly generated) UUID.

Usage

From source file:coyote.batch.web.decorator.MessageIdentifier.java

/**
 * @see coyote.batch.web.decorator.RequestDecorator#process(org.apache.http.HttpMessage)
 *//*from www .  j a va 2s . c  om*/
@Override
public void process(HttpMessage request) {
    request.setHeader(headerName, UUID.randomUUID().toString());
}

From source file:com.moha.demo.utils.Hashsalt.java

public AsUser saveTo(String password) {
    UUID uuid = UUID.randomUUID();
    String salt = uuid.toString().replace("-", "");
    String hashPassword = encrypt(password + salt);
    AsUser u = new AsUser();
    u.setSalt(salt);// w  ww  .  j a  v a  2 s  .co m
    u.setUserPassword(hashPassword);
    return u;
}

From source file:edu.pitt.resumecore.Symptom.java

private void newSymptom(String symptomName) {
    this.symptomID = UUID.randomUUID().toString();
    this.symptomName = symptomName;
    String sql = "INSERT INTO emr.symptoms (symptomID,symptomName) VALUES ";
    sql += "('" + this.symptomID + "', '" + StringUtilities.cleanMySqlInsert(this.symptomName) + "')";
    db.executeQuery(sql);/*from  w w w . ja v a 2s. co  m*/
}

From source file:com.vehicles.domain.entities.Boat.java

private void init(Color color, boolean floats, int periscopes) {
    this.id = UUID.randomUUID().toString();
    this.color = color;
    this.floats = floats;
    this.periscopes = periscopes;
}

From source file:AdminAssetCreateTest.java

public static String TEST_ASSET_NAME() {
    if (assetName == null)
        assetName = TEST_ASSET_NAME_ + UUID.randomUUID();
    return assetName;
}

From source file:de.kaiserpfalzEdv.office.ui.web.widgets.content.AddMainTabEvent.java

public AddMainTabEvent(final UUID id, final String title, final Component component) {
    super(UUID.randomUUID(), id);
    this.title = title;
    this.component = component;
}

From source file:com.crushpaper.UuidlIdGenerator.java

@Override
public String getAnotherId() {
    final UUID uuid = UUID.randomUUID();
    final ByteBuffer bb = ByteBuffer.wrap(new byte[16]);
    bb.putLong(uuid.getMostSignificantBits());
    bb.putLong(uuid.getLeastSignificantBits());
    return Base64.encodeBase64URLSafeString(bb.array());
}

From source file:models.utils.StringUtils.java

public static String getRandomHostname() {
    String randomStr = UUID.randomUUID().toString();
    randomStr = randomStr.substring(0, 12);
    return randomStr;
}

From source file:com.thoughtworks.go.util.TempFiles.java

public static File createUniqueFile(String prefix) {
    return new File(tempFolder(), prefix + "-" + UUID.randomUUID());
}

From source file:com.allogy.io.NoNewEditsInputStreamTest.java

@Test
public void stream_should_return_inner_stream_followed_by_comma_new_edits_false() throws IOException {
    String innerString = "[" + UUID.randomUUID().toString() + "]";
    InputStream innerInputStream = IOUtils.toInputStream(innerString);

    String stringFromObjectUnderTest = IOUtils.toString(new NoNewEditsInputStream(innerInputStream));

    assertThat(stringFromObjectUnderTest, notNullValue());

    assertThat(stringFromObjectUnderTest.startsWith(innerString), is(true));
    String prependedString = stringFromObjectUnderTest.substring(innerString.length());
    assertThat(prependedString, is(", \"new_edits\": false"));
}