@Override public int hashCode() { final int hc = 7; if (getUri() != null) { return hc * getUri().hashCode(); } return hc * getValue().hashCode(); }
/** Copy this objects values into the parameter * * @param val to be updated */ public void copyTo(final BwAttachment val) { val.setFmtType(getFmtType()); val.setValueType(getValueType()); val.setEncoding(getEncoding()); val.setUri(getUri()); val.setValue(getValue()); }
@Override public String toString() { final ToString ts = new ToString(this); toStringSegment(ts); ts.append("fmttype", getFmtType()); ts.append("valueType", getValueType()); ts.append("encoding", getEncoding()); if (getUri() != null) { ts.append("uri", getUri()); } else { ts.append("value", getValue()); } return ts.toString(); }
@Override public int compareTo(final BwAttachment that) { if (this == that) { return 0; } int res = CalFacadeUtil.cmpObjval(getEncoding(), that.getEncoding()); if (res != 0) { return res; } res = CalFacadeUtil.cmpObjval(getUri(), that.getUri()); if (res != 0) { return res; } return CalFacadeUtil.cmpObjval(getValue(), that.getValue()); }
/** make an attachment * * @param val * @return Attendee * @throws Throwable */ public static Attach setAttachment(final BwAttachment val) throws Throwable { ParameterList pars = new ParameterList(); String temp = val.getFmtType(); if (temp != null) { pars.add(new FmtType(temp)); } temp = val.getEncoding(); if (temp == null) { return new Attach(pars, val.getUri()); } else { pars.add(new Encoding(temp)); temp = val.getValueType(); if (temp != null) { pars.add(new Value(temp)); } return new Attach(pars, val.getValue()); } }