本文整理了Java中java.lang.Boolean.toString()
方法的一些代码示例,展示了Boolean.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Boolean.toString()
方法的具体详情如下:
包路径:java.lang.Boolean
类名称:Boolean
方法名:toString
[英]Returns a string containing a concise, human-readable description of this boolean.
[中]返回一个字符串,其中包含此布尔值的简明易读描述。
代码示例来源:origin: apache/incubator-dubbo
public void setGeneric(Boolean generic) {
if (generic != null) {
this.generic = generic.toString();
}
}
代码示例来源:origin: apache/incubator-dubbo
public void setGeneric(Boolean generic) {
if (generic != null) {
this.generic = generic.toString();
}
}
代码示例来源:origin: spring-projects/spring-framework
/**
* Programmatically set a local flag to "true", overriding an
* entry in the {@code spring.properties} file (if any).
* @param key the property key
*/
public static void setFlag(String key) {
localProperties.put(key, Boolean.TRUE.toString());
}
代码示例来源:origin: spring-projects/spring-framework
/**
* Set the (new) value of the {@code Access-Control-Allow-Credentials} response header.
*/
public void setAccessControlAllowCredentials(boolean allowCredentials) {
set(ACCESS_CONTROL_ALLOW_CREDENTIALS, Boolean.toString(allowCredentials));
}
代码示例来源:origin: libgdx/libgdx
@Override
public Preferences putBoolean (String key, boolean val) {
properties.put(key, Boolean.toString(val));
return this;
}
代码示例来源:origin: libgdx/libgdx
@Override
public Preferences putBoolean (String key, boolean val) {
properties.put(key, Boolean.toString(val));
return this;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public Object operate(Operation operation, Object leftOperand, Object rightOperand) throws EvaluationException {
if (operation==Operation.ADD) {
return ((String)leftOperand)+((Boolean)rightOperand).toString();
}
else {
return leftOperand;
}
}
代码示例来源:origin: spring-projects/spring-framework
public void arrayz(boolean... bs) {
s = "";
if (bs != null) {
s = "";
for (boolean b: bs) {
s += Boolean.toString(b);
}
}
}
代码示例来源:origin: spring-projects/spring-framework
public String getString() {
return Boolean.toString(this.initialized);
}
}
代码示例来源:origin: apache/incubator-dubbo
public static boolean isReturnTypeFuture(Invocation inv) {
return Boolean.TRUE.toString().equals(inv.getAttachment(Constants.FUTURE_RETURNTYPE_KEY));
}
代码示例来源:origin: apache/incubator-dubbo
public static boolean isReturnTypeFuture(Invocation inv) {
return Boolean.TRUE.toString().equals(inv.getAttachment(Constants.FUTURE_RETURNTYPE_KEY));
}
代码示例来源:origin: spring-projects/spring-framework
public static Runnable buildManagedTask(Runnable task, String identityName) {
Map<String, String> properties;
if (task instanceof SchedulingAwareRunnable) {
properties = new HashMap<>(4);
properties.put(ManagedTask.LONGRUNNING_HINT,
Boolean.toString(((SchedulingAwareRunnable) task).isLongLived()));
}
else {
properties = new HashMap<>(2);
}
properties.put(ManagedTask.IDENTITY_NAME, identityName);
return ManagedExecutors.managedTask(task, properties, null);
}
代码示例来源:origin: apache/incubator-dubbo
private static boolean isAttachInvocationId(URL url, Invocation invocation) {
String value = url.getMethodParameter(invocation.getMethodName(), Constants.AUTO_ATTACH_INVOCATIONID_KEY);
if (value == null) {
// add invocationid in async operation by default
return isAsync(url, invocation);
} else if (Boolean.TRUE.toString().equalsIgnoreCase(value)) {
return true;
} else {
return false;
}
}
代码示例来源:origin: apache/incubator-dubbo
public static boolean isAsync(URL url, Invocation inv) {
boolean isAsync;
if (Boolean.TRUE.toString().equals(inv.getAttachment(Constants.ASYNC_KEY))) {
isAsync = true;
} else {
isAsync = url.getMethodParameter(getMethodName(inv), Constants.ASYNC_KEY, false);
}
return isAsync;
}
代码示例来源:origin: apache/incubator-dubbo
public static boolean isOneway(URL url, Invocation inv) {
boolean isOneway;
if (Boolean.FALSE.toString().equals(inv.getAttachment(Constants.RETURN_KEY))) {
isOneway = true;
} else {
isOneway = !url.getMethodParameter(getMethodName(inv), Constants.RETURN_KEY, true);
}
return isOneway;
}
代码示例来源:origin: apache/incubator-dubbo
public static boolean isOneway(URL url, Invocation inv) {
boolean isOneway;
if (Boolean.FALSE.toString().equals(inv.getAttachment(Constants.RETURN_KEY))) {
isOneway = true;
} else {
isOneway = !url.getMethodParameter(getMethodName(inv), Constants.RETURN_KEY, true);
}
return isOneway;
}
代码示例来源:origin: apache/incubator-dubbo
public static boolean isAsync(URL url, Invocation inv) {
boolean isAsync;
if (Boolean.TRUE.toString().equals(inv.getAttachment(Constants.ASYNC_KEY))) {
isAsync = true;
} else {
isAsync = url.getMethodParameter(getMethodName(inv), Constants.ASYNC_KEY, false);
}
return isAsync;
}
代码示例来源:origin: apache/incubator-dubbo
private static boolean isAttachInvocationId(URL url, Invocation invocation) {
String value = url.getMethodParameter(invocation.getMethodName(), Constants.AUTO_ATTACH_INVOCATIONID_KEY);
if (value == null) {
// add invocationid in async operation by default
return isAsync(url, invocation);
} else if (Boolean.TRUE.toString().equalsIgnoreCase(value)) {
return true;
} else {
return false;
}
}
代码示例来源:origin: apache/incubator-dubbo
public LazyConnectExchangeClient(URL url, ExchangeHandler requestHandler) {
// lazy connect, need set send.reconnect = true, to avoid channel bad status.
this.url = url.addParameter(Constants.SEND_RECONNECT_KEY, Boolean.TRUE.toString());
this.requestHandler = requestHandler;
this.initialState = url.getParameter(Constants.LAZY_CONNECT_INITIAL_STATE_KEY, Constants.DEFAULT_LAZY_CONNECT_INITIAL_STATE);
this.requestWithWarning = url.getParameter(REQUEST_WITH_WARNING_KEY, false);
}
代码示例来源:origin: apache/incubator-dubbo
public LazyConnectExchangeClient(URL url, ExchangeHandler requestHandler) {
// lazy connect, need set send.reconnect = true, to avoid channel bad status.
this.url = url.addParameter(Constants.SEND_RECONNECT_KEY, Boolean.TRUE.toString());
this.requestHandler = requestHandler;
this.initialState = url.getParameter(Constants.LAZY_CONNECT_INITIAL_STATE_KEY, Constants.DEFAULT_LAZY_CONNECT_INITIAL_STATE);
this.requestWithWarning = url.getParameter(REQUEST_WITH_WARNING_KEY, false);
}
内容来源于网络,如有侵权,请联系作者删除!