本文整理了Java中java.lang.Boolean.getBoolean()
方法的一些代码示例,展示了Boolean.getBoolean()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Boolean.getBoolean()
方法的具体详情如下:
包路径:java.lang.Boolean
类名称:Boolean
方法名:getBoolean
[英]Returns the boolean value of the system property identified by string.
[中]返回由字符串标识的系统属性的布尔值。
代码示例来源:origin: org.mockito/mockito-core
public static boolean isAndroidMockMakerRequired() {
return Boolean.getBoolean("org.mockito.mock.android");
}
代码示例来源:origin: apache/zookeeper
/**
* Return true if extended ephemeral types are enabled
*
* @return true/false
*/
public static boolean extendedEphemeralTypesEnabled() {
return Boolean.getBoolean(EXTENDED_TYPES_ENABLED_PROPERTY);
}
代码示例来源:origin: GoogleContainerTools/jib
/**
* Gets whether or not to serialize Jib's execution. This is defined by the {@code jibSerialize}
* system property.
*
* @return {@code true} if Jib's execution should be serialized, {@code false} if not
*/
public static boolean isSerializedExecutionEnabled() {
return Boolean.getBoolean(SERIALIZE);
}
代码示例来源:origin: GoogleContainerTools/jib
/**
* Gets whether or not to allow sending authentication information over insecure HTTP connections.
* This is defined by the {@code sendCredentialsOverHttp} system property.
*
* @return {@code true} if authentication information is allowed to be sent over insecure
* connections, {@code false} if not
*/
public static boolean isSendCredentialsOverHttpEnabled() {
return Boolean.getBoolean(SEND_CREDENTIALS_OVER_HTTP);
}
代码示例来源:origin: robolectric/robolectric
public static boolean loggingEnabled() {
return Boolean.getBoolean(LOGGING_ENABLED);
}
}
代码示例来源:origin: apache/zookeeper
/**
* Return syncEnabled.
*
* @return
*/
public boolean getSyncEnabled() {
if (System.getProperty(SYNC_ENABLED) != null) {
LOG.info(SYNC_ENABLED + "=" + Boolean.getBoolean(SYNC_ENABLED));
return Boolean.getBoolean(SYNC_ENABLED);
} else {
return syncEnabled;
}
}
代码示例来源:origin: PipelineAI/pipeline
@Override
public Boolean get() {
if (System.getProperty(name) == null) {
return fallback;
}
return Boolean.getBoolean(name);
}
代码示例来源:origin: hibernate/hibernate-orm
public Boolean convert(Object value) {
if ( value == null ) {
return null;
}
if ( Boolean.class.isInstance( value ) ) {
return (Boolean) value;
}
if ( String.class.isInstance( value ) ) {
return Boolean.getBoolean( (String) value );
}
throw unknownConversion( value, Boolean.class );
}
}
代码示例来源:origin: oracle/opengrok
@Override
boolean supportsSubRepositories() {
String val = System.getenv(NOFOREST_PROPERTY_KEY);
return !(val == null
? Boolean.getBoolean(NOFOREST_PROPERTY_KEY)
: Boolean.parseBoolean(val));
}
代码示例来源:origin: apache/incubator-dubbo
/**
* Check if an ipv6 address is reachable.
*
* @param address the given address
* @return true if it is reachable
*/
static boolean isValidV6Address(Inet6Address address) {
boolean preferIpv6 = Boolean.getBoolean("java.net.preferIPv6Addresses");
if (!preferIpv6) {
return false;
}
try {
return address.isReachable(100);
} catch (IOException e) {
// ignore
}
return false;
}
代码示例来源:origin: apache/incubator-dubbo
/**
* Check if an ipv6 address is reachable.
*
* @param address the given address
* @return true if it is reachable
*/
static boolean isValidV6Address(Inet6Address address) {
boolean preferIpv6 = Boolean.getBoolean("java.net.preferIPv6Addresses");
if (!preferIpv6) {
return false;
}
try {
return address.isReachable(100);
} catch (IOException e) {
// ignore
}
return false;
}
代码示例来源:origin: apache/zookeeper
private static boolean isLog4jJmxEnabled() {
boolean enabled = false;
try {
Class.forName("org.apache.log4j.spi.LoggerRepository");
if (Boolean.getBoolean("zookeeper.jmx.log4j.disable")) {
LOG.info("Log4j found but jmx support is disabled.");
} else {
enabled = true;
LOG.info("Log4j found with jmx enabled.");
}
} catch (ClassNotFoundException e) {
LOG.info("Log4j not found.");
}
return enabled;
}
代码示例来源:origin: org.testng/testng
private static boolean isTooVerbose() {
return Boolean.getBoolean(TestNG.SHOW_TESTNG_STACK_FRAMES) || TestRunner.getVerbose() >= 2;
}
代码示例来源:origin: facebook/litho
private static synchronized void updateCachedIsAccessibilityEnabled(
AccessibilityManager manager) {
cachedIsAccessibilityEnabled =
Boolean.getBoolean("is_accessibility_enabled")
|| isRunningApplicableAccessibilityService(manager);
isCachedIsAccessibilityEnabledSet = true;
}
代码示例来源:origin: commons-collections/commons-collections
protected boolean skipSerializedCanonicalTests() {
return Boolean.getBoolean("org.apache.commons.collections:with-clover");
}
代码示例来源:origin: apache/zookeeper
/**
* Set the System property; return the old value for caching.
*
* @param sysprop property
* @param debug true or false
* @return the previous value
*/
private boolean getAndSet(String sysprop, String debug) {
boolean old = Boolean.getBoolean(sysprop);
System.setProperty(sysprop, debug);
return old;
}
}
代码示例来源:origin: facebook/litho
public static boolean isAccessibilityEnabled(AccessibilityManager manager) {
if (isCachingEnabled) {
if (!isCachedIsAccessibilityEnabledSet) {
updateCachedIsAccessibilityEnabled(manager);
}
return cachedIsAccessibilityEnabled;
} else {
return Boolean.getBoolean("is_accessibility_enabled")
|| isRunningApplicableAccessibilityService(manager);
}
}
代码示例来源:origin: eclipse-vertx/vert.x
static ResolverProvider factory(Vertx vertx, AddressResolverOptions options) {
// For now not really plugable, we just want to not fail when we can't load the async provider
// that use an unstable API and fallback on the default (blocking) provider
try {
if (!Boolean.getBoolean(DISABLE_DNS_RESOLVER_PROP_NAME)) {
return new DnsResolverProvider((VertxImpl) vertx, options);
}
} catch (Throwable e) {
if (e instanceof VertxException) {
throw e;
}
Logger logger = LoggerFactory.getLogger(ResolverProvider.class);
logger.info("Using the default address resolver as the dns resolver could not be loaded");
}
return new DefaultResolverProvider();
}
代码示例来源:origin: org.mockito/mockito-core
SubclassInjectionLoader() {
if (!Boolean.getBoolean("org.mockito.internal.noUnsafeInjection") && ClassInjector.UsingReflection.isAvailable()) {
this.loader = new WithReflection();
} else if (ClassInjector.UsingLookup.isAvailable()) {
this.loader = tryLookup();
} else {
throw new MockitoException(join(ERROR_MESSAGE, "", Platform.describe()));
}
}
代码示例来源:origin: oracle/opengrok
@Override
public boolean isSatisfied() {
if (Boolean.getBoolean(forceSystemProperty())) {
return true;
}
return Util.isUnix();
}
内容来源于网络,如有侵权,请联系作者删除!