public List<BwXproperty> getXproperties(String val) { return entity.getXproperties(val); }
public List<BwXproperty> getXproperties() { return entity.getXproperties(); }
/** * @param val */ @NoProxy public void removeXproperty(final BwXproperty val) { List<BwXproperty> c = getXproperties(); if (c == null) { return; } c.remove(val); }
public List<BwXproperty> getMasterCollection() { return getTarget().getXproperties(); } };
@Override @NoProxy public void addXproperty(final BwXproperty val) { List<BwXproperty> c = getXproperties(); if (c == null) { c = new ArrayList<>(); setXproperties(c); } if (!c.contains(val)) { c.add(val); } }
/** Get the winning item id * * @return Integer item id */ public Integer getPollWinner() { final List<BwXproperty> props = getXproperties(BwXproperty.pollWinner); if (Util.isEmpty(props)) { return null; } if (props.size() > 1) { return null; } final BwXproperty p = props.get(0); return Integer.valueOf(p.getValue()); }
/** * @return int */ @NoProxy @NoDump public int getNumXproperties() { List<BwXproperty> c = getXproperties(); if (c == null) { return 0; } return c.size(); }
@Override @NoProxy @NoDump public List<BwXproperty> getXproperties(final String val) { final List<BwXproperty> res = new ArrayList<>(); final List<BwXproperty> xs = getXproperties(); if (xs == null) { return res; } for (final BwXproperty x: xs) { if (x.getName().equals(val)) { res.add(x); } } return res; }
/** * @param userHref of user who owns property * @param name of property * @return x-prop for this user if found * @throws CalFacadeException */ @NoProxy public BwXproperty findPeruserXprop(final String userHref, final String name) throws CalFacadeException { final List<BwXproperty> pus = getXproperties(name); for (final BwXproperty pu: pus) { if (userHref.equals(pu.getParam(BwXproperty.peruserOwnerParam))) { return pu; } } return null; }
/** * @return List of x-properties */ @NoProxy public List<BwXproperty> cloneXproperty() { if (getNumXproperties() == 0) { return null; } ArrayList<BwXproperty> xs = new ArrayList<BwXproperty>(); for (BwXproperty x: getXproperties()) { xs.add((BwXproperty)x.clone()); } return xs; }
/** Remove all instances of the named property. * * @param val - name to match * @return number of removed proeprties */ @NoProxy @NoDump public int removeXproperties(final String val) { List<BwXproperty> xs = getXproperties(val); if (xs.size() == 0) { return 0; } for (BwXproperty x: xs) { removeXproperty(x); } return xs.size(); }
/** Get the event's poll item id * * @return Integer event's poll item id */ public Integer getPollItemId() { final List<BwXproperty> props = getXproperties(BwXproperty.pollItemId); if (Util.isEmpty(props)) { return null; } if (props.size() > 1) { return null; } final BwXproperty p = props.get(0); final PollItmId pid = new PollItmId(p.getValue()); return pid.getId(); }
/** Clear the vpoll voters * */ @NoProxy public void clearVvoters() { final List<BwXproperty> props = getXproperties(BwXproperty.pollVoter); if (Util.isEmpty(props)) { return; } for (final BwXproperty p: props) { removeXproperty(p); } }
/** Find x-properties storing the value of the named ical property * * @param val - name to match * @return list of matching properties - never null * @throws CalFacadeException */ @NoProxy @NoDump public List<BwXproperty> getXicalProperties(final String val) throws CalFacadeException { List<BwXproperty> res = new ArrayList<>(); List<BwXproperty> xs = getXproperties(); if (xs == null) { return res; } for (BwXproperty x: xs) { if (x.getName().equals(BwXproperty.bedeworkIcalProp)) { List<Xpar> xpars = x.getParameters(); Xpar xp = xpars.get(0); if (xp.getName().equals(val)) { res.add(x); } } } return res; }
/** Get the vpoll items (candidates) * * @return Set<String> candidates */ @IcalProperty(pindex = PropertyInfoIndex.POLL_ITEM, vpollProperty = true ) @NoProxy public Set<String> getPollItems() { final List<BwXproperty> props = getXproperties(BwXproperty.pollItem); if (Util.isEmpty(props)) { return null; } final Set<String> vals = new TreeSet<>(); for (final BwXproperty p: props) { vals.add(p.getValue()); } return vals; }
/** Get the vpoll items (candidates) * * @return Set<String> candidates */ @IcalProperty(pindex = PropertyInfoIndex.VVOTER, vpollProperty = true ) @NoProxy public Set<String> getVvoters() { final List<BwXproperty> props = getXproperties(BwXproperty.pollVoter); if (Util.isEmpty(props)) { return null; } final Set<String> vals = new TreeSet<>(); for (final BwXproperty p: props) { vals.add(p.getValue()); } return vals; }
/** Clear the vpoll items * * @return Set<String> names */ @NoProxy public void clearPollItems() { final List<BwXproperty> props = getXproperties(BwXproperty.pollItem); if (Util.isEmpty(props)) { return; } for (final BwXproperty p: props) { removeXproperty(p); } }
/** Suggested to values. * * @return list of suggested to objects */ @NoProxy @NoDump @NoWrap public List<SuggestedTo> getSuggested() { final List<SuggestedTo> ss = new ArrayList<>(); for (final BwXproperty xp: getXproperties(BwXproperty.bedeworkSuggestedTo)) { // Ignore bad values final SuggestedTo st = SuggestedTo.make(xp.getValue()); if (st != null) { ss.add(st); } } return ss; }
/** * @param name * @return first property or null */ @NoProxy @NoDump @NoWrap public BwXproperty findXproperty(final String name) { Collection<BwXproperty> props = getXproperties(); if (props == null) { return null; } for (BwXproperty prop: props) { if (name.equals(prop.getName())) { return prop; } } return null; }
public void setXproperties(List<BwXproperty> val) { if (val instanceof OverrideList) { val = ((OverrideList<BwXproperty>)val).getOverrideCollection(); } int res = doSet(ProxiedFieldIndex.pfiXproperties, false, getTarget().getXproperties(), ref.getXproperties(), val); if (res == setRefNull) { ref.setXproperties(null); } if (res == setRefVal) { ref.setXproperties(val); } }