/** Constructor * * @param code * @param description */ public BwRequestStatus(final String code, final String description) { this(code, new BwString(null, description), null); }
@Override public void addDescription(final String lang, final String val) { addDescription(new BwString(lang, val)); }
@Override public void addDisplayName(final String lang, final String val) { addDisplayName(new BwString(lang, val)); }
/** Set an entity value based on the string value. * * @param lang * @param val */ public void setValue(String lang, String val) { setEntity(new BwString(lang, val)); } }
@Override @NoProxy public void addComment(final String lang, final String val) { addComment(new BwString(lang, val)); }
@Override @NoProxy public void addResource(final String lang, final String val) { addResource(new BwString(lang, val)); }
@Override public Object clone() { return new BwString(getLang(), getValue()); } }
public BwString getCombined(final BwString val) { if (val != null) { val.setValue(getCombined()); return val; } return new BwString(null, getCombined()); } }
/** Used fpr constructors */ public static class TriggerVal { /** This specifies the time for the alarm in rfc format */ public String trigger; /** true if we trigger off the start */ public boolean triggerStart; /** true if trigger is a date time value */ public boolean triggerDateTime; }
public void setStatus(final String val) { if (getCn() == null) { setCn(new BwString(val, null)); } else { getCn().setLang(val); } }
public void setStatus(final String val) { if (getAddress() == null) { setAddress(new BwString(val, null)); } else { getAddress().setLang(val); } }
public void setStatus(final String val) { if (getDescription() == null) { setDescription(new BwString(val, null)); } else { getDescription().setLang(val); } }
/** * @param val * @return BwRequestStatus */ public static BwRequestStatus fromRequestStatus(final RequestStatus val) { BwString str = new BwString(null, val.getDescription()); // LANG return new BwRequestStatus(val.getStatusCode(), str, val.getExData()); }
@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)); } }
@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)); } }
/** * @param val new category */ public void setWordVal(final String val) { BwString s = getWord(); if (val == null) { if (s != null) { addDeletedEntity(s); setWord(null); } return; } if (s == null) { s = new BwString(); setWord(s); } s.setValue(val); }
/** * @param val new description value */ public void setDescriptionVal(final String val) { BwString s = getDescription(); if (val == null) { if (s != null) { addDeletedEntity(s); setDescription(null); } return; } if (s == null) { s = new BwString(); setDescription(s); } s.setValue(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; }
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; }
private static boolean checkLocation(final IcalCallback cb, final ChangeTable chg, final BwEvent ev, final Property prop) throws CalFacadeException { final Parameter param = prop.getParameter(XcalTags.xBedeworkLocationKey.getLocalPart()); final String val = prop.getValue(); final BwLocation evloc = ev.getLocation(); final BwLocation loc; if (param == null) { final BwString sval = new BwString(null, val); loc = cb.getLocation(sval); if (loc == null) { return false; } } else { final GetEntityResponse<BwLocation> resp = cb.fetchLocationByKey(param.getValue(), val); if (resp.getStatus() != ok) { return false; } loc = resp.getEntity(); } ev.setLocation(loc); chg.changed(PropertyIndex.PropertyInfoIndex.LOCATION, evloc, loc); return true; }