@Override public BwString findDescription(final String lang) { return BwString.findLang(lang, getDescriptions()); }
private String value(final BwString val) { if (val == null) { return null; } return val.getValue(); }
BwString key = new BwString(lang, wd); new BwString(null, pval)); lang = getLang(prop); String uid = getUidPar(prop); BwString nm = new BwString(lang, pval); addr = new BwString(lang, pval); loc = cb.findLocation(addr); } else if ((loc != null) && (evloc != null)) { String evval = evloc.getAddress().getValue(); String inval = loc.getAddress().getValue(); if (!evval.equals(inval)) { chg.changed(pi, evval, inval); evloc.getAddress().setValue(inval); BwString rsrc = new BwString(lang, (String)rit.next()); chg.addValue(pi, rsrc);
/** Constructor * * @param code * @param description */ public BwRequestStatus(final String code, final String description) { this(code, new BwString(null, description), null); }
@Override public void updateSummaries(final String lang, final String val) { BwString s = findSummary(lang); if (val == null) { // Removing if (s!= null) { removeSummary(s); } } else if (s == null) { addSummary(new BwString(lang, val)); } else if ((CalFacadeUtil.cmpObjval(val, s.getValue()) != 0)) { // XXX Cannot change value in case this is an override collection. //s.setValue(val); removeSummary(s); addSummary(new BwString(lang, val)); } }
private static boolean checkContact(final IcalCallback cb, final ChangeTable chg, final BwEvent ev, final String lang, final String val) throws CalFacadeException { final BwString sval = new BwString(lang, val); final BwContact c = cb.findContact(sval); if (c == null) { return false; } final Set<BwContact> cs = ev.getContacts(); if (cs != null) { for (final BwContact c1 : cs) { if (c.getCn().equals(sval)) { // Already present return true; } } } ev.addContact(c); chg.addValue(PropertyInfoIndex.CONTACT, c); return true; }
/** * * @param cat the other one * @return true if anything changed */ public boolean updateFrom(final BwCategory cat) { boolean changed = false; if (!getWord().equals(cat.getWord())) { setWord(cat.getWord()); changed = true; } if (Util.cmpObjval(getDescription(), cat.getDescription()) != 0) { setDescription(cat.getDescription()); changed = true; } return changed; }
/** * @return String */ public String getStatus() { final BwString s = getDescription(); if (s == null) { return null; } return s.getLang(); }
@Override public int hashCode() { int hc = getCode().hashCode(); if (getDescription() != null) { hc *= getDescription().hashCode(); } if (getData() != null) { hc *= getData().hashCode(); } return hc; }
public int compareTo(final Object o) { if (o == this) { return 0; } if (o == null) { return -1; } if (!(o instanceof BwRequestStatus)) { return -1; } BwRequestStatus that = (BwRequestStatus)o; int res = CalFacadeUtil.cmpObjval(getCode(), that.getCode()); if (res != 0) { return res; } res = getDescription().compareTo(that.getDescription()); if (res != 0) { return res; } return CalFacadeUtil.cmpObjval(getData(), that.getData()); }
@Override public void addDisplayName(final String lang, final String val) { addDisplayName(new BwString(lang, val)); }
@Override @NoProxy public void updateSummaries(final String lang, final String val) { BwString s = findSummary(lang); if (val == null) { // Removing if (s!= null) { removeSummary(s); } } else if (s == null) { addSummary(new BwString(lang, val)); } else if ((CalFacadeUtil.cmpObjval(val, s.getValue()) != 0)) { // XXX Cannot change value in case this is an override Set. //s.setValue(val); removeSummary(s); addSummary(new BwString(lang, val)); } }
private static boolean checkCategory(final IcalCallback cb, final ChangeTable chg, final BwEvent ev, final String lang, final String val) throws CalFacadeException { final BwString sval = new BwString(lang, val); final BwCategory cat = cb.findCategory(sval); if (cat == null) { return false; } final Set<BwCategory> cats = ev.getCategories(); if (cats != null) { for (final BwCategory c : cats) { if (c.getWord().equals(sval)) { // Already present return true; } } } ev.addCategory(cat); chg.addValue(PropertyIndex.PropertyInfoIndex.CATEGORIES, cat); return true; }