本文整理了Java中net.roboconf.core.utils.Utils.getValue()
方法的一些代码示例,展示了Utils.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getValue()
方法的具体详情如下:
包路径:net.roboconf.core.utils.Utils
类名称:Utils
方法名:getValue
[英]Returns the value contained in a map of string if it exists using the key.
[中]返回字符串映射中包含的值(如果使用键存在)。
代码示例来源:origin: net.roboconf/roboconf-messaging-rabbitmq
KeyStore ks = KeyStore.getInstance( getValue( configuration, RABBITMQ_SSL_KEY_STORE_TYPE, DEFAULT_SSL_KEY_STORE_TYPE ));
ks.load( clientIS, keyStorePassphrase );
String value = getValue( configuration, RABBITMQ_SSL_KEY_MNGR_FACTORY, DEFAULT_SSL_MNGR_FACTORY );
KeyManagerFactory kmf = KeyManagerFactory.getInstance( value );
kmf.init( ks, keyStorePassphrase );
KeyStore tks = KeyStore.getInstance( getValue( configuration, RABBITMQ_SSL_TRUST_STORE_TYPE, DEFAULT_SSL_TRUST_STORE_TYPE ));
tks.load( storeIS, trustStorePassphrase );
value = getValue( configuration, RABBITMQ_SSL_TRUST_MNGR_FACTORY, DEFAULT_SSL_MNGR_FACTORY );
TrustManagerFactory tmf = TrustManagerFactory.getInstance( value );
tmf.init( tks );
SSLContext c = SSLContext.getInstance( getValue( configuration, RABBITMQ_SSL_PROTOCOL, DEFAULT_SSL_PROTOCOL ));
c.init( kmf.getKeyManagers(), tmf.getTrustManagers(), null );
factory.useSslProtocol( c );
代码示例来源:origin: roboconf/roboconf-platform
@Test
public void testGetValue() throws Exception {
Map<String,String> map = new HashMap<>();
for(int i=0;i<10;i++) {
map.put(""+i, "toto"+i);
}
Assert.assertEquals(10, map.size());
for(int i=0;i<10;i++) {
Assert.assertEquals("toto"+i, Utils.getValue(map, ""+i, "tata"));
}
Assert.assertEquals("tata", Utils.getValue(map, "coucou", "tata"));
}
内容来源于网络,如有侵权,请联系作者删除!