Example usage for java.lang StringBuffer hashCode

List of usage examples for java.lang StringBuffer hashCode

Introduction

In this page you can find the example usage for java.lang StringBuffer hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:it.cnr.icar.eric.server.common.Utility.java

/**
 * Mimics javamail boundary id generator
 */// w ww  .j av  a 2  s. c o m
public static String getMimeBoundary() {
    javax.mail.Session session = null; //Session.getDefaultInstance(new Properties());

    String s = null;
    javax.mail.internet.InternetAddress internetaddress = javax.mail.internet.InternetAddress
            .getLocalAddress(session);

    if (internetaddress != null) {
        s = internetaddress.getAddress();
    } else {
        s = "javamailuser@localhost";
    }

    StringBuffer stringbuffer = new StringBuffer();
    stringbuffer.append(stringbuffer.hashCode()).append('.').append(System.currentTimeMillis()).append('.')
            .append("eric.").append(s);

    return stringbuffer.toString();
}

From source file:org.freebxml.omar.server.common.Utility.java

/**
 * Mimics javamail boundary id generator
 *///from  w  w w .  jav  a2 s  .com
public static String getMimeBoundary() {
    javax.mail.Session session = null; //Session.getDefaultInstance(new Properties());

    String s = null;
    javax.mail.internet.InternetAddress internetaddress = javax.mail.internet.InternetAddress
            .getLocalAddress(session);

    if (internetaddress != null) {
        s = internetaddress.getAddress();
    } else {
        s = "javamailuser@localhost";
    }

    StringBuffer stringbuffer = new StringBuffer();
    stringbuffer.append(stringbuffer.hashCode()).append('.').append(System.currentTimeMillis()).append('.')
            .append("omar.").append(s);

    return stringbuffer.toString();
}

From source file:org.ojbc.bundles.adapters.staticmock.samplegen.CriminalHistorySampleGenerator.java

private String addLocationElement(Document parentDocument, PersonElementWrapper person, Element rapSheet) {
    StringBuffer fullAddress = new StringBuffer(1024);
    fullAddress.append(person.streetAddress).append(" ").append(person.city).append(", ").append(person.state)
            .append(" ").append(person.zipCode);
    String id = "L" + String.valueOf(fullAddress.hashCode());
    Element location = appendElement(rapSheet, OjbcNamespaceContext.NS_NC, "Location");
    XmlUtils.addAttribute(location, OjbcNamespaceContext.NS_STRUCTURES, "id", id);

    Element e = appendElement(location, OjbcNamespaceContext.NS_NC, "LocationAddress");
    e = appendElement(e, OjbcNamespaceContext.NS_NC, "AddressFullText");
    e.setTextContent(fullAddress.toString());

    return id;//from  w w w  .  ja  va2 s . c  o m
}