org.bedework.util.misc.Util.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.bedework.util.misc.Util.isEmpty()方法的一些代码示例,展示了Util.isEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isEmpty()方法的具体详情如下:
包路径:org.bedework.util.misc.Util
类名称:Util
方法名:isEmpty

Util.isEmpty介绍

暂无

代码示例

代码示例来源:origin: org.bedework/bw-util-dav

/**
 */
public DavUtil(final List<Header> extraHeaders) {
 this();
 if (!Util.isEmpty(extraHeaders)) {
  this.extraHeaders = new ArrayList<>(extraHeaders);
 }
}

代码示例来源:origin: org.bedework/bw-util-dav

/**
 * @param nm a QName
 * @return DavProp or null
 */
public DavProp findProp(final QName nm) {
 if (Util.isEmpty(propVals)) {
  return null;
 }
 for (DavProp dp: propVals) {
  if (nm.equals(dp.name)) {
   return dp;
  }
 }
 return null;
}
@Override

代码示例来源:origin: org.bedework/bw-util-http

public void par(final String name,
        final List<String> value) {
 if (Util.isEmpty(value)) {
  return;
 }
 req.append(delim);
 delim = "&";
 req.append(delim);
 req.append(name);
 req.append("=");
 req.append(String.join(",", value));
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

@Override
public boolean removeProperty(final BwProperty val) {
 final Set<BwProperty> c = getProperties();
 if (Util.isEmpty(c)) {
  return false;
 }
 return c.remove(val);
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

public FilterBase getFilter() {
  final List<FilterBase> c = getChildren();
  if (Util.isEmpty(c)) {
   return null;
  }

  return c.get(0);
 }
}

代码示例来源:origin: org.bedework/bw-caldav-util

/** Convenience method
 *
 * @param cf
 * @return boolean true if this element matches all of the
 *                  named component types.
 */
public static boolean matchAll(final CompFilterType cf) {
 return (cf.getTimeRange() == null)  &&
     Util.isEmpty(cf.getCompFilter()) &&
     Util.isEmpty(cf.getPropFilter());
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

public void setFlds(final List<String> vals) {
 if (Util.isEmpty(vals)) {
  setVal(null);
  return;
 }
 for (int i = 0; i < vals.size(); i++) {
  setFld(i, vals.get(i));
 }
}

代码示例来源:origin: org.bedework/bw-caldav-util

public CollectionChangesType copyForAlias(final String collectionHref) {
 final CollectionChangesType copy = new CollectionChangesType();
 copyForAlias(copy, collectionHref);
 
 if (!Util.isEmpty(changedByList)) {
  copy.changedByList = new ArrayList<>(changedByList);
 }
 
 copy.prop = prop;
 copy.childCreated = childCreated;
 copy.childDeleted = childDeleted;
 copy.childUpdated = childUpdated;
 return copy;
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/** 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());
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/**
 * @param val the supported component names e.g. "VEVENT", "VTODO" etc.
 */
public void setSupportedComponents(final List<String> val) {
 supportedComponents = val;
 if (Util.isEmpty(val)) {
  removeQproperty(CaldavTags.supportedCalendarComponentSet);
  return;
 }
 StringBuilder sb = new StringBuilder();
 String delim = "";
 for (String s: val) {
  sb.append(delim);
  sb.append(s);
 }
 setQproperty(CaldavTags.supportedCalendarComponentSet,
        sb.toString());
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/**
 * @return KeyFld
 */
@IcalProperty(pindex = PropertyInfoIndex.LOC_KEYS_FLD,
    nested = true,
    jname = "locKeys")
public List<KeyFld> getKeys() {
 final List<String> vals = fetchKeysSplit().getFlds();
 if (Util.isEmpty(vals)) {
  return null;
 }
 return vals.stream()
       .map(stringToKeyFld)
       .collect(Collectors.<KeyFld> toList());
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

public boolean removeOverride(final String rid) throws CalFacadeException {
 EventOverride ov = null;
 if (Util.isEmpty(overrides)) {
  return false;
 }
 
 for (final EventOverride eo: overrides) {
  if (eo.getEvent().getRecurrenceId().equals(rid)) {
   ov = eo;
   break;
  }
 }
 if (ov == null) {
  return false;
 }
 
 overrides.remove(ov);
 return true;
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-api

public static Properties getPr() throws CalFacadeException {
 try {
  final SystemProperties sysProps = 
      CalSvcFactoryDefault.getSystemProperties();
  /* Load properties file */
  final Properties pr = new Properties();
  if (Util.isEmpty(sysProps.getSyseventsProperties())) {
   throw new CalFacadeException("No sysevent properties defined");
  }
  
  final StringBuilder sb = new StringBuilder();
  @SuppressWarnings("unchecked")
  final List<String> ps = sysProps.getSyseventsProperties();
  for (final String p: ps) {
   sb.append(p);
   sb.append("\n");
  }
  pr.load(new StringReader(sb.toString()));
  return pr;
 } catch (final CalFacadeException cfe) {
  throw cfe;
 } catch (final Throwable t) {
  //Logger.getLogger(CalSvcFactoryDefault.class.getName()).throwing(CalSvcFactory.class, t);
  throw new CalFacadeException(t.getMessage());
 }
}

代码示例来源:origin: org.bedework/bw-caldav-util

/**
 * @return an encoded content type - used internally
 */
public String getContentType() {
 final StringBuilder sb = new StringBuilder("notification;type=");
 final QName qn = getNotification().getElementName();
 sb.append(qn);
 final List<AttributeType> attrs = getNotification().getElementAttributes();
 if (!Util.isEmpty(attrs)) {
  for (final AttributeType attr: attrs) {
   sb.append(";noteattr_");
   sb.append(attr.getName());
   sb.append("=");
   sb.append(attr.getValue());
  }
 }
 return sb.toString();
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/** 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();
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/** 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;
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/** 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;
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/** 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);
 }
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/** 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);
 }
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

public BwCalendar shallowClone() {
 final BwCalendar cal = new BwCalendar();
 super.copyTo(cal);
 cal.setName(getName());
 cal.setPath(getPath());
 cal.setSummary(getSummary());
 cal.setDescription(getDescription());
 cal.setMailListId(getMailListId());
 cal.setCalType(getCalType());
 cal.setCreated(getCreated());
 final BwCollectionLastmod lm = (BwCollectionLastmod)getLastmod().clone();
 lm.setDbEntity(cal);
 cal.setLastmod(lm);
 cal.setAliasUri(getAliasUri());
 cal.setDisplay(getDisplay());
 cal.setAffectsFreeBusy(getAffectsFreeBusy());
 cal.setIgnoreTransparency(getIgnoreTransparency());
 cal.setUnremoveable(getUnremoveable());
 cal.setRefreshRate(getRefreshRate());
 cal.setLastRefresh(getLastRefresh());
 cal.setLastEtag(getLastEtag());
 cal.setFilterExpr(getFilterExpr());
 
 if (!Util.isEmpty(getCategoryHrefs())) {
  final Set<String> uids = new TreeSet<>(getCategoryHrefs());
  cal.setCategoryHrefs(uids);
 }
 return cal;
}

相关文章

微信公众号

最新文章

更多