org.msgpack.value.Value.isNilValue()方法的使用及代码示例

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

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

Value.isNilValue介绍

[英]Returns true if type of this value is Nil. If this method returns true, asNilValue never throws exceptions. Note that you can't use instanceof or cast ((NilValue) thisValue) to check type of a value because type of a mutable value is variable.
[中]如果此值的类型为Nil,则返回true。如果此方法返回true,asNilValue永远不会抛出异常。请注意,不能使用instanceof或强制转换((NilValue) thisValue)来检查值的类型,因为可变值的类型是可变的。

代码示例

代码示例来源:origin: org.msgpack/msgpack-core

@Override
public boolean equals(Object o)
{
  if (o == this) {
    return true;
  }
  if (!(o instanceof Value)) {
    return false;
  }
  return ((Value) o).isNilValue();
}

代码示例来源:origin: io.digdag/digdag-standards

private static void addCsvValue(Writer out, Value value)
  throws IOException
{
  if (value.isStringValue()) {
    addCsvText(out, value.asStringValue().asString());
  }
  else if (value.isNilValue()) {
    // write nothing
  }
  else {
    addCsvText(out, value.toJson());
  }
}

代码示例来源:origin: apache/attic-polygene-java

if( value == null || value.isNilValue() )

相关文章