/** * Returns whether it has the URI of the group. * * @return whether it has the URI of the group */ public boolean hasHref() { return getHref() != null; }
/** * Immutable constructor. * * @param deleted whether the contact was removed from the group. * @param href URI of the group. */ public GroupMembershipInfo(Boolean deleted, String href) { super(); setDeleted(deleted); setHref(href); setImmutable(true); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } GroupMembershipInfo other = (GroupMembershipInfo) obj; return eq(deleted, other.deleted) && eq(href, other.href); }
/** * Returns an Object of Group Membership Info GData contacts object. This method takes a formatted OM * Element and converts to GroupMembershipInfo Object. * * @param messageContext Synapse Message Context. * @param membershipElement The parent element containing the individual elements. * @return an object of Group Membership Info. * @throws ValidationException validationException is thrown if herf attribute is missing. */ protected final GroupMembershipInfo getGroupMembershipInfoList(final MessageContext messageContext, final OMElement membershipElement) throws ValidationException { GroupMembershipInfo membershipInfo = new GroupMembershipInfo(); String herf = membershipElement.getAttributeValue(new QName(Constants.HERF)); if (herf != null) { membershipInfo .setDeleted(Boolean.valueOf(membershipElement.getAttributeValue(new QName(Constants.DELETED)))); membershipInfo.setHref(herf); } else { throw new ValidationException("Missing attribute: href"); } return membershipInfo; }
GroupMembershipInfo g = new GroupMembershipInfo(); g.setHref(groupNameId); entry.getGroupMembershipInfos().add(g); contactsService.update(new URL(entry.getEditLink().getHref()), entry);
/** * Sets the URI of the group. * * @param href URI of the group or <code>null</code> to reset */ public void setHref(String href) { throwExceptionIfImmutable(); this.href = href; }
@Override protected void validate() { if (href == null) { throwExceptionForMissingAttribute(HREF); } }
/** * Returns whether it has the whether the contact was removed from the group. * * @return whether it has the whether the contact was removed from the group */ public boolean hasDeleted() { return getDeleted() != null; }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(ContactEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(ContactEntry.class, new ExtensionDescription(Deleted.class, new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "deleted", false, false, false)); extProfile.declare(ContactEntry.class, GroupMembershipInfo.getDefaultDescription(false, true)); }
/** * Sets the URI of the group. * * @param href URI of the group or <code>null</code> to reset */ public void setHref(String href) { throwExceptionIfImmutable(); this.href = href; }
@Override protected void validate() { if (href == null) { throwExceptionForMissingAttribute(HREF); } }
/** * Returns whether it has the whether the contact was removed from the group. * * @return whether it has the whether the contact was removed from the group */ public boolean hasDeleted() { return getDeleted() != null; }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(ContactEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(ContactEntry.class, new ExtensionDescription(Deleted.class, new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "deleted", false, false, false)); extProfile.declare(ContactEntry.class, GroupMembershipInfo.getDefaultDescription(false, true)); }
/** * Immutable constructor. * * @param deleted whether the contact was removed from the group. * @param href URI of the group. */ public GroupMembershipInfo(Boolean deleted, String href) { super(); setDeleted(deleted); setHref(href); setImmutable(true); }
/** * Returns whether it has the URI of the group. * * @return whether it has the URI of the group */ public boolean hasHref() { return getHref() != null; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } GroupMembershipInfo other = (GroupMembershipInfo) obj; return eq(deleted, other.deleted) && eq(href, other.href); }
/** * Sets the whether the contact was removed from the group. * * @param deleted whether the contact was removed from the group or * <code>null</code> to reset */ public void setDeleted(Boolean deleted) { throwExceptionIfImmutable(); this.deleted = deleted; }
@Override protected void validate() { if (href == null) { throwExceptionForMissingAttribute(HREF); } }
/** * Returns whether it has the whether the contact was removed from the group. * * @return whether it has the whether the contact was removed from the group */ public boolean hasDeleted() { return getDeleted() != null; }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(ContactEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(ContactEntry.class, new ExtensionDescription(Deleted.class, new XmlNamespace("gd", "http://schemas.google.com/g/2005"), "deleted", false, false, false)); extProfile.declare(ContactEntry.class, GroupMembershipInfo.getDefaultDescription(false, true)); extProfile.declare(ContactEntry.class, YomiName.class); }