/** * Immutable constructor. * * @param label label. * @param rel relation type. * @param value value. */ public Relation(String label, Rel rel, String value) { super(); setLabel(label); setRel(rel); setValue(value); setImmutable(true); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Relation other = (Relation) obj; return eq(label, other.label) && eq(rel, other.rel) && eq(value, other.value); }
/** * Returns whether it has the label. * * @return whether it has the label */ public boolean hasLabel() { return getLabel() != null; }
/** * Returns a list containing Relation GData extension objects. This method takes a formatted OM Element * and converts it to a list of event objects. * * @param relationsElement The parent element containing the individual elements. * @return a list containing GData extension Relation objects. */ protected final List<Relation> getRelationList(final OMElement relationsElement) { Map<String, Relation.Rel> relationRelMap = buildRelationRelMap(); List<Relation> relationList = new ArrayList<Relation>(); Iterator< ? > relationIterator = relationsElement.getChildElements(); while (relationIterator.hasNext()) { OMElement singleRelationElement = (OMElement) relationIterator.next(); Relation relation = new Relation(); relation.setRel(relationRelMap.get(singleRelationElement.getLocalName())); relation.setValue(singleRelationElement.getText()); relationList.add(relation); } return relationList; }
/** * Returns whether it has the value. * * @return whether it has the value */ public boolean hasValue() { return getValue() != null; }
/** * Returns whether it has the relation type. * * @return whether it has the relation type */ public boolean hasRel() { return getRel() != null; }
extProfile.declare(BasePersonEntry.class, Priority.class); extProfile.declare(BasePersonEntry.class, Relation.getDefaultDescription(false, true)); extProfile.declare(BasePersonEntry.class, Sensitivity.class); extProfile.declare(BasePersonEntry.class, ShortName.class);
/** * Returns whether it has the value. * * @return whether it has the value */ public boolean hasValue() { return getValue() != null; }
/** * Returns whether it has the relation type. * * @return whether it has the relation type */ public boolean hasRel() { return getRel() != null; }
extProfile.declare(BasePersonEntry.class, Priority.class); extProfile.declare(BasePersonEntry.class, Relation.getDefaultDescription(false, true)); extProfile.declare(BasePersonEntry.class, Sensitivity.class); extProfile.declare(BasePersonEntry.class, ShortName.class);
/** * Immutable constructor. * * @param label label. * @param rel relation type. * @param value value. */ public Relation(String label, Rel rel, String value) { super(); setLabel(label); setRel(rel); setValue(value); setImmutable(true); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Relation other = (Relation) obj; return eq(label, other.label) && eq(rel, other.rel) && eq(value, other.value); }
/** * Returns whether it has the value. * * @return whether it has the value */ public boolean hasValue() { return getValue() != null; }
/** * Returns whether it has the label. * * @return whether it has the label */ public boolean hasLabel() { return getLabel() != null; }
/** * Returns whether it has the relation type. * * @return whether it has the relation type */ public boolean hasRel() { return getRel() != null; }
extProfile.declare(BasePersonEntry.class, Priority.class); extProfile.declare(BasePersonEntry.class, Relation.getDefaultDescription(false, true)); extProfile.declare(BasePersonEntry.class, Sensitivity.class); extProfile.declare(BasePersonEntry.class, ShortName.class);
/** * Immutable constructor. * * @param label label. * @param rel relation type. * @param value value. */ public Relation(String label, Rel rel, String value) { super(); setLabel(label); setRel(rel); setValue(value); setImmutable(true); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Relation other = (Relation) obj; return eq(label, other.label) && eq(rel, other.rel) && eq(value, other.value); }
/** * Returns whether it has the label. * * @return whether it has the label */ public boolean hasLabel() { return getLabel() != null; }