/** * Returns whether it has the whether this is the primary email address. * * @return whether it has the whether this is the primary email address */ public boolean hasPrimary() { return getPrimary() != null; }
URL feedUrl = new URL("https://www.google.com/m8/feeds/contacts/default/full"); ContactFeed resultFeed = myService.getFeed(feedUrl, ContactFeed.class); for (ContactEntry entry : resultFeed.getEntries()) { for (Email email : entry.getEmailAddresses()) { if (email.getPrimary()) { System.out.print(" " + email.getAddress()); System.out.print("\n"); } } }
@Override public int hashCode() { int result = getClass().hashCode(); if (getAddress() != null) { result = 37 * result + getAddress().hashCode(); } if (getDisplayName() != null) { result = 37 * result + getDisplayName().hashCode(); } if (getLabel() != null) { result = 37 * result + getLabel().hashCode(); } if (getPrimary() != null) { result = 37 * result + getPrimary().hashCode(); } if (getRel() != null) { result = 37 * result + getRel().hashCode(); } return result; }
@Override public int hashCode() { int result = getClass().hashCode(); if (getAddress() != null) { result = 37 * result + getAddress().hashCode(); } if (getDisplayName() != null) { result = 37 * result + getDisplayName().hashCode(); } if (getLabel() != null) { result = 37 * result + getLabel().hashCode(); } if (getPrimary() != null) { result = 37 * result + getPrimary().hashCode(); } if (getRel() != null) { result = 37 * result + getRel().hashCode(); } return result; } }
@Override public int hashCode() { int result = getClass().hashCode(); if (getAddress() != null) { result = 37 * result + getAddress().hashCode(); } if (getDisplayName() != null) { result = 37 * result + getDisplayName().hashCode(); } if (getLabel() != null) { result = 37 * result + getLabel().hashCode(); } if (getPrimary() != null) { result = 37 * result + getPrimary().hashCode(); } if (getRel() != null) { result = 37 * result + getRel().hashCode(); } return result; } }
System.out.print(" label:" + email.getLabel()); if (email.getPrimary()) { System.out.print(" (primary) ");
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Email other = (Email) obj; return eq(getAddress(), other.getAddress()) && eq(getDisplayName(), other.getDisplayName()) && eq(getLabel(), other.getLabel()) && eq(getPrimary(), other.getPrimary()) && eq(getRel(), other.getRel()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Email other = (Email) obj; return eq(getAddress(), other.getAddress()) && eq(getDisplayName(), other.getDisplayName()) && eq(getLabel(), other.getLabel()) && eq(getPrimary(), other.getPrimary()) && eq(getRel(), other.getRel()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Email other = (Email) obj; return eq(getAddress(), other.getAddress()) && eq(getDisplayName(), other.getDisplayName()) && eq(getLabel(), other.getLabel()) && eq(getPrimary(), other.getPrimary()) && eq(getRel(), other.getRel()); }