java.lang.Boolean.booleanValue()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(226)

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

Boolean.booleanValue介绍

[英]Gets the primitive value of this boolean, either true or false.
[中]获取此布尔值的基元值,为true或false。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Is default HTML escaping active? Falls back to {@code false} in case of no explicit default given.
 */
public boolean isDefaultHtmlEscape() {
  return (this.defaultHtmlEscape != null && this.defaultHtmlEscape.booleanValue());
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Is default HTML escaping active? Falls back to {@code false} in case of
 * no explicit default given.
 */
public boolean isDefaultHtmlEscape() {
  return (this.defaultHtmlEscape != null && this.defaultHtmlEscape.booleanValue());
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Is HTML escaping using the response encoding by default?
 * If enabled, only XML markup significant characters will be escaped with UTF-* encodings.
 * <p>Falls back to {@code true} in case of no explicit default given, as of Spring 4.2.
 * @since 4.1.2
 */
public boolean isResponseEncodedHtmlEscape() {
  return (this.responseEncodedHtmlEscape == null || this.responseEncodedHtmlEscape.booleanValue());
}

代码示例来源:origin: apache/incubator-dubbo

@Override
  public Object decode(Object jv) {
    if (jv instanceof Boolean) {
      return ((Boolean) jv).booleanValue();
    }
    return false;
  }
};

代码示例来源:origin: apache/incubator-dubbo

@Override
  public Object decode(Object jv) {
    if (jv instanceof Boolean) {
      return ((Boolean) jv).booleanValue();
    }
    return false;
  }
};

代码示例来源:origin: apache/incubator-dubbo

public static boolean unboxed(Boolean v) {
  return v == null ? false : v.booleanValue();
}

代码示例来源:origin: apache/incubator-dubbo

public static boolean unboxed(Boolean v) {
  return v == null ? false : v.booleanValue();
}

代码示例来源:origin: org.apache.commons/commons-lang3

/**
 * Sets the value from any Boolean instance.
 *
 * @param value  the value to set, not null
 * @throws NullPointerException if the object is null
 */
@Override
public void setValue(final Boolean value) {
  this.value = value.booleanValue();
}

代码示例来源:origin: org.apache.commons/commons-lang3

/**
 * Constructs a new MutableBoolean with the specified value.
 *
 * @param value  the initial value to store, not null
 * @throws NullPointerException if the object is null
 */
public MutableBoolean(final Boolean value) {
  super();
  this.value = value.booleanValue();
}

代码示例来源:origin: prestodb/presto

protected boolean _useTimestampExplicitOnly(SerializerProvider provider) {
  if (_useTimestamp != null) {
    return _useTimestamp.booleanValue();
  }
  return false;
}

代码示例来源:origin: apache/incubator-dubbo

/**
 * get boolean value.
 *
 * @param index index.
 * @param def   default value.
 * @return value or default value.
 */
public boolean getBoolean(int index, boolean def) {
  Object tmp = mArray.get(index);
  return tmp != null && tmp instanceof Boolean ? ((Boolean) tmp).booleanValue() : def;
}

代码示例来源:origin: apache/incubator-dubbo

/**
 * get boolean value.
 *
 * @param index index.
 * @param def   default value.
 * @return value or default value.
 */
public boolean getBoolean(int index, boolean def) {
  Object tmp = mArray.get(index);
  return tmp != null && tmp instanceof Boolean ? ((Boolean) tmp).booleanValue() : def;
}

代码示例来源:origin: shuzheng/zheng

@Override
public void setProperties(Properties properties) {
  super.setProperties(properties);
  this.addGWTInterface = Boolean.valueOf(properties.getProperty("addGWTInterface")).booleanValue();
  this.suppressJavaInterface = Boolean.valueOf(properties.getProperty("suppressJavaInterface")).booleanValue();
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Return the HTML escaping setting for this tag,
 * or the default setting if not overridden.
 * @see #isDefaultHtmlEscape()
 */
protected boolean isHtmlEscape() {
  if (this.htmlEscape != null) {
    return this.htmlEscape.booleanValue();
  }
  else {
    return isDefaultHtmlEscape();
  }
}

代码示例来源:origin: alibaba/druid

@Override
public boolean getBoolean(int columnIndex) throws SQLException {
  Object obj = getObject(columnIndex);
  if (obj == null) {
    return false;
  }
  return ((Boolean) obj).booleanValue();
}

代码示例来源:origin: spring-projects/spring-framework

public boolean getBooleanProperty(String name) throws JMSException {
  Object value = this.properties.get(name);
  return (value instanceof Boolean) ? ((Boolean) value).booleanValue() : false;
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Overridden to default to {@code true} in case of no explicit default given.
 */
@Override
protected boolean isDefaultHtmlEscape() {
  Boolean defaultHtmlEscape = getRequestContext().getDefaultHtmlEscape();
  return (defaultHtmlEscape == null || defaultHtmlEscape.booleanValue());
}

代码示例来源:origin: alibaba/druid

public void postVisit(SQLObject x) {
  if (x instanceof SQLStatement) {
    SQLStatement stmt = (SQLStatement) x;
    boolean printSemi = printStatementAfterSemi == null
        ? stmt.isAfterSemi()
        : printStatementAfterSemi.booleanValue();
    if (printSemi) {
      print(';');
    }
  }
}

代码示例来源:origin: alibaba/fastjson

public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
  SerializeWriter out = serializer.out;
  Boolean value = (Boolean) object;
  if (value == null) {
    out.writeNull(SerializerFeature.WriteNullBooleanAsFalse);
    return;
  }
  if (value.booleanValue()) {
    out.write("true");
  } else {
    out.write("false");
  }
}

代码示例来源:origin: google/guava

public void testGetDefaultValue() {
  assertEquals(false, Defaults.defaultValue(boolean.class).booleanValue());
  assertEquals('\0', Defaults.defaultValue(char.class).charValue());
  assertEquals(0, Defaults.defaultValue(byte.class).byteValue());
  assertEquals(0, Defaults.defaultValue(short.class).shortValue());
  assertEquals(0, Defaults.defaultValue(int.class).intValue());
  assertEquals(0, Defaults.defaultValue(long.class).longValue());
  assertEquals(0.0f, Defaults.defaultValue(float.class).floatValue());
  assertEquals(0.0d, Defaults.defaultValue(double.class).doubleValue());
  assertNull(Defaults.defaultValue(void.class));
  assertNull(Defaults.defaultValue(String.class));
 }
}

相关文章