Example usage for javax.xml.registry.infomodel EmailAddress hashCode

List of usage examples for javax.xml.registry.infomodel EmailAddress hashCode

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel EmailAddress 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.client.ui.thin.RegistryObjectCollectionBean.java

private List<RegistryObjectBean> getEmailAddressesSearchResultsBeans(RegistryObjectBean roBean)
        throws ClassNotFoundException, NoSuchMethodException, ExceptionInInitializerError, Exception {
    Collection<?> emailAddresses = roBean.getEmailAddresses();
    if (emailAddresses == null) {
        return null;
    }/*ww w. j  av  a2  s.c  o m*/
    int numEmailAddressObjects = emailAddresses.size();
    @SuppressWarnings("unused")
    ArrayList<Object> list = new ArrayList<Object>(numEmailAddressObjects);

    Iterator<?> roItr = emailAddresses.iterator();
    if (log.isDebugEnabled()) {
        log.debug("Query results: ");
    }

    String objectType = "EmailAddress";
    int numCols = 2;
    // Replace ObjectType with Id. TODO - formalize this convention
    List<RegistryObjectBean> roBeans = new ArrayList<RegistryObjectBean>(numEmailAddressObjects);
    for (@SuppressWarnings("unused")
    int i = 0; roItr.hasNext(); i++) {
        EmailAddress emailAddress = (EmailAddress) roItr.next();
        String header = null;
        Object columnValue = null;
        @SuppressWarnings("unused")
        List<?> srvbHeader = new ArrayList<Object>(numCols);
        List<SearchResultValueBean> searchResultValueBeans = new ArrayList<SearchResultValueBean>(numCols);

        header = WebUIResourceBundle.getInstance().getString("Details");
        columnValue = roBean.getId() + "." + emailAddress.hashCode();
        searchResultValueBeans.add(new SearchResultValueBean(header, columnValue));

        header = WebUIResourceBundle.getInstance().getString("Email Address");
        columnValue = emailAddress.getAddress();
        searchResultValueBeans.add(new SearchResultValueBean(header, columnValue));

        header = WebUIResourceBundle.getInstance().getString("Type");
        columnValue = emailAddress.getType();
        searchResultValueBeans.add(new SearchResultValueBean(header, columnValue));

        header = "";
        columnValue = "";
        searchResultValueBeans.add(new SearchResultValueBean(header, columnValue));

        RegistryObjectBean srb = new RegistryObjectBean(searchResultValueBeans, roBean.getRegistryObject(),
                objectType, emailAddress, false);
        roBeans.add(srb);
    }
    return roBeans;
}