Java 8 Dictionary - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Dictionary class.

This code example shows how to use the following methods: put, containsKey, get, putAll
    @TargetsContainer("iiop-client") 
    public static Archive<?> clientDeployment() { 
 
        String ejbJar = FileUtils.readFile(TransactionIIOPInvocationTestCase.class, "ejb-jar.xml");
 
        final Properties properties = new Properties();
        properties.putAll(System.getProperties());
        if(properties.containsKey("node1")) {
            properties.put("node1", NetworkUtils.formatPossibleIpv6Address((String) properties.get("node1")));
        } 
 
        final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "client.jar");
        jar.addClasses(ClientEjb.class, IIOPTransactionalHome.class,
                IIOPTransactionalRemote.class, TransactionIIOPInvocationTestCase.class 
                , IIOPTransactionalStatefulHome.class, IIOPTransactionalStatefulRemote.class) 
                .addAsManifestResource(TransactionIIOPInvocationTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml")
                .addAsManifestResource(new StringAsset(PropertiesValueResolver.replaceProperties(ejbJar, properties)), "ejb-jar.xml");
        return jar;
    } 
 

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: get, put
 
    synchronized boolean put(String pid, Dictionary<String, String> source, boolean rollback) {
        AtomicLong serialId = getSerialId(pid);
 
        // Asign a serialid to the source if we don't already have one 
        String sourceid = source.get(TRANSIENT_PROPERTY_SERIAL_ID);
        if (sourceid == null) {
            sourceid = new Long(serialId.incrementAndGet()).toString();
            source.put(TRANSIENT_PROPERTY_SERIAL_ID, sourceid);
        } 
 
        // Ignore the serialid on rollback 
        if (rollback) {
            LOGGER.debugf("Config rollback: %s => %s", pid, source);
            serialId.set(Long.parseLong(sourceid));
            configurations.put(pid, source);
            return true; 
        } 
 
        // Update if there is no previous config for this pid 

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: put
	 * of the managed resource. 
	 */ 
	@Override 
	public ObjectName getObjectName(Object managedBean, String beanKey) throws MalformedObjectNameException {
		String domain = ClassUtils.getPackageName(managedBean.getClass());
		Hashtable<String, String> keys = new Hashtable<String, String>();
		keys.put(TYPE_KEY, ClassUtils.getShortName(managedBean.getClass()));
		keys.put(HASH_CODE_KEY, ObjectUtils.getIdentityHexString(managedBean));
		return ObjectNameManager.getInstance(domain, keys);
	} 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: put
        Dictionary<String, String> configA = new Hashtable<String, String>();
        configA.put("foo", "bar");
        Assert.assertTrue(state.put("pidA", configA, false));
        Assert.assertEquals("bar", state.get("pidA").get("foo"));
 
        Dictionary<String, String> configB = new Hashtable<String, String>();
        configB.put("foo", "baz");
        Assert.assertTrue(state.put("pidA", configB, false));
        Assert.assertEquals("baz", state.get("pidA").get("foo"));
 
        Assert.assertFalse(state.put("pidA", configA, false));
        Assert.assertEquals("baz", state.get("pidA").get("foo"));
    } 
 
    @Test 
    public void testRemoveConfiguration() throws Exception { 
        ConfigAdminState state = new ConfigAdminState();
 
        Dictionary<String, String> configA = new Hashtable<String, String>();
        configA.put("foo", "bar");
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: get
     */ 
    public void activate(ComponentContext context) { 
        @SuppressWarnings("unchecked") 
        Dictionary<String, Object> properties = context.getProperties(); 
 
        path = (String) properties.get("path"); 
        rootUri = (String) properties.get("rootUri"); 
 
        String indexName = (String) properties.get("indexName"); 
 
        if (indexName != null) 
            this.indexName = indexName; 
 
        Boolean deeplyAccessible = (Boolean) properties.get("deeplyAccessible"); 
 
        if (deeplyAccessible != null) 
            this.deeplyAccessible = deeplyAccessible; 
 
        Boolean modifiable = (Boolean) properties.get("modifiable"); 
 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Java 8 Dictionary Methods: