本文整理了Java中org.bedework.util.misc.Util.checkNull()
方法的一些代码示例,展示了Util.checkNull()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.checkNull()
方法的具体详情如下:
包路径:org.bedework.util.misc.Util
类名称:Util
方法名:checkNull
暂无
代码示例来源:origin: org.bedework/bw-util-servlet
/** Get a request parameter stripped of white space. Return null for zero
* length.
*
* @param name name of parameter
* @return String value
*/
public String getReqPar(final String name) {
return Util.checkNull(request.getParameter(name));
}
代码示例来源:origin: org.bedework/bw-util-servlet
/** Get a request parameter stripped of white space. Return default for null
* or zero length.
*
* @param name name of parameter
* @param def default value
* @return String value
*/
public String getReqPar(final String name, final String def) {
final String s = Util.checkNull(request.getParameter(name));
if (s != null) {
return s;
}
return def;
}
代码示例来源:origin: org.bedework/bw-util-servlet
/** Get a multi-valued request parameter stripped of white space.
* Return null for zero length.
*
* @param name name of parameter
* @return List<String> or null
* @throws Throwable
*/
public List<String> getReqPars(final String name) throws Throwable {
String[] s = request.getParameterValues(name);
ArrayList<String> res = null;
if ((s == null) || (s.length == 0)) {
return null;
}
for (String par: s) {
par = Util.checkNull(par);
if (par != null) {
if (res == null) {
res = new ArrayList<>();
}
res.add(par);
}
}
return res;
}
代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade
/** Set the calendar color property
*
* @param val
*/
public void setColor(final String val) {
if (Util.checkNull(val) == null) {
BwProperty p = findProperty(AppleIcalTags.calendarColor.getLocalPart());
if (p != null) {
removeProperty(p);
}
} else {
setProperty(AppleIcalTags.calendarColor.getLocalPart(), val);
}
}
代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade
/** Set the event list
*
* @param val
*/
public void setSubscriptionId(final String val) {
if (Util.checkNull(val) == null) {
BwProperty p = findProperty(subscriptionIdProperty);
if (p != null) {
removeProperty(p);
}
} else {
setProperty(subscriptionIdProperty, val);
}
}
代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade
/** Check this is properly trimmed
*
* @return boolean true if changed
*/
public boolean checkNulls() {
boolean changed = false;
String str = Util.checkNull(getName());
if (CalFacadeUtil.compareStrings(str, getName()) != 0) {
setName(str);
changed = true;
}
str = Util.checkNull(getValue());
if (CalFacadeUtil.compareStrings(str, getValue()) != 0) {
setValue(str);
changed = true;
}
return changed;
}
代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade
/** Check this is properly trimmed
*
* @return boolean true if changed
*/
public boolean checkNulls() {
boolean changed = false;
String str = Util.checkNull(getLang());
if (CalFacadeUtil.compareStrings(str, getLang()) != 0) {
setLang(str);
changed = true;
}
str = Util.checkNull(getValue());
if (CalFacadeUtil.compareStrings(str, getValue()) != 0) {
setValue(str);
changed = true;
}
return changed;
}
内容来源于网络,如有侵权,请联系作者删除!