/** * @return String */ public String getStatus() { final BwString s = getDescription(); if (s == null) { return null; } return s.getLang(); }
public void setStatus(final String val) { if (getDescription() == null) { setDescription(new BwString(val, null)); } else { getDescription().setLang(val); } }
/** Delete the category's description - this must be called rather than setting * the value to null. * */ public void deleteDescription() { addDeletedEntity(getDescription()); setDescription(null); }
/** * @return String */ @NoDump public String getDescriptionVal() { final BwString s = getDescription(); if (s == null) { return null; } return s.getValue(); }
/** * * @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; }
@Override public void afterDeletion() { addDeletedEntity(getWord()); addDeletedEntity(getDescription()); }
/** Size to use for quotas. * * @return int */ @Override public int length() { return super.length() + getWord().length() + getDescription().length(); }
@Override public Object clone() { final BwCategory cat = new BwCategory(); super.copyTo(cat); cat.setWord((BwString)getWord().clone()); if (getDescription() != null) { cat.setDescription((BwString)getDescription().clone()); } cat.setName(getName()); return cat; } }
/** Size to use for quotas. * * @return int */ @Override @NoDump public int getSize() { return super.length() + QuotaUtil.size(getWord()) + QuotaUtil.size(getDescription()); }
/** * @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); }
public void toJson(final JsonGenerator jgen) throws CalFacadeException { try { jgen.writeStartObject(); outJsonField("name", getName(), jgen); outJsonField("href", getHref(), jgen); outJsonField("colPath", getColPath(), jgen); outJsonField("uid", getUid(), jgen); outJsonBwString("word", getWord(), jgen); outJsonBwString("description", getDescription(), jgen); jgen.writeEndObject(); // category } catch (final Throwable t) { throw new CalFacadeException(t); } }