Examples of containsKey()


Examples of org.apache.commons.collections.map.LinkedMap.containsKey()

            return foundEvents;
        }
       
        // Find the start index. This is either the index after the last processed index, or - if the last processed
        // index is not available in the queue - the first index in the queue.
        if (events.containsKey(index)) {
            index = (Long) events.nextKey(index);
        }
        else {
            index = (Long) events.firstKey();
        }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap.containsKey()

    @Test
    public void testReferenceMap_shouldWork() throws Exception {
        ReferenceMap map = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.WEAK);
        Object referent = new Object();
        map.put("42", referent);
        assertThat(map.containsKey("42"), is(true));
        assertThat(map.get("42"), sameInstance(referent));
        referent = null;
        System.gc();
        assertThat(map.containsKey("42"), is(false));
        assertThat(map.get("42"), nullValue());
View Full Code Here

Examples of org.apache.commons.collections15.BidiMap.containsKey()

        it.setValue(newValue1);
        confirmed.put(key1, newValue1);
        assertSame(key1, it.getKey());
        assertSame(newValue1, it.getValue());
        assertEquals(true, bidi.containsKey(key1));
        assertEquals(true, bidi.containsValue(newValue1));
        assertEquals(newValue1, bidi.get(key1));
        verify();

        it.setValue(newValue1)// same value - should be OK
View Full Code Here

Examples of org.apache.commons.collections15.IterableMap.containsKey()

        map.put(I1A, I2A);
        assertEquals(1, map.size());
        assertSame(I2A, map.get(I1A));
        assertSame(null, map.get(I1B));
        assertEquals(true, map.containsKey(I1A));
        assertEquals(false, map.containsKey(I1B));
        assertEquals(true, map.containsValue(I2A));
        assertEquals(false, map.containsValue(I2B));

        map.put(I1A, I2B);
View Full Code Here

Examples of org.apache.commons.collections15.SortedBidiMap.containsKey()

        Object firstValue = sm.get(first);
        Object secondValue = sm.get(second);

        SortedMap head = sm.headMap(toKey);
        assertEquals(1, head.size());
        assertEquals(true, sm.containsKey(first));
        assertEquals(true, head.containsKey(first));
        assertEquals(true, sm.containsValue(firstValue));
        assertEquals(true, head.containsValue(firstValue));
        assertEquals(true, sm.containsKey(second));
        assertEquals(false, head.containsKey(second));
View Full Code Here

Examples of org.apache.commons.configuration.AbstractConfiguration.containsKey()

    @PostConstruct
    public void init() {
        final AbstractConfiguration configInst = ConfigurationManager.getConfigInstance();

        if (configInst.containsKey(AdminResourcesContainer.DEFAULT_PAGE_PROP_NAME)) {
            logger.info("Admin container default page already set to: " +
                    configInst.getString(AdminResourcesContainer.DEFAULT_PAGE_PROP_NAME + ", not overriding."));
            return;
        }
        configInst.setProperty(AdminResourcesContainer.DEFAULT_PAGE_PROP_NAME, ADMINRES_WEBADMIN_INDEX_HTML);
View Full Code Here

Examples of org.apache.commons.configuration.BaseConfiguration.containsKey()

        assertEquals("new", prop2.get());   
        source.setDeleted("prop1=DoesNotMatter");
        source.setChanged("prop2=changed");
        source.setAdded("");
        Thread.sleep(200);
        assertFalse(config.containsKey("prop1"));
        assertNull(prop1.get());
        assertEquals("changed", config.getProperty("prop2"));  
        assertEquals("changed", prop2.get());
    }
View Full Code Here

Examples of org.apache.commons.configuration.CompositeConfiguration.containsKey()

    // Now validate them
    List<String> missingProperties = new ArrayList<String>();
    for (Setting setting : settings.keySet()) {
      if (setting.defaultValue().isEmpty()) {
        if (!config.containsKey(setting.name())) {
          missingProperties.add(setting.name());
        }
      }
    }
    if (missingProperties.size() > 0) {
View Full Code Here

Examples of org.apache.commons.configuration.Configuration.containsKey()

        if (subset == null)
        {
            throw new IllegalArgumentException("Mapped property '" + name + "' does not exist.");
        }

        return subset.containsKey(key);
    }

    public Object get(String name, int index)
    {
        try
View Full Code Here

Examples of org.apache.commons.configuration.HierarchicalConfiguration.containsKey()

        HierarchicalConfiguration config = createCombinedConfiguration();
        assertEquals("Wrong number of services", 0, config
                .getMaxIndex("net.service.url"));
        assertEquals("Wrong service", "http://service1.org", config
                .getString("net.service.url"));
        assertFalse("Type attribute available", config
                .containsKey("net.service.url[@type]"));
    }

    /**
     * Tests if a list from the second structure is added if it is not defined
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.