Package org.apache.commons.collections.keyvalue

Examples of org.apache.commons.collections.keyvalue.DefaultMapEntry


            public Object[] toArray(Object[] arr) {
                ArrayList list = new ArrayList();
                Iterator iterator = iterator();
                while (iterator.hasNext()) {
                    Entry e = (Entry)iterator.next();
                    list.add(new DefaultMapEntry(e.getKey(), e.getValue()));
                }
                return list.toArray(arr);
            }
        };
        return entrySet;
View Full Code Here


        assertEquals("#0000FF", test.get("BLUE"));
        assertEquals(3, test.size());

        // map entry
        test = MapUtils.putAll(new HashMap(), new Object[] {
            new DefaultMapEntry("RED", "#FF0000"),
            new DefaultMapEntry("GREEN", "#00FF00"),
            new DefaultMapEntry("BLUE", "#0000FF")
        });
        assertEquals(true, test.containsKey("RED"));
        assertEquals("#FF0000", test.get("RED"));
        assertEquals(true, test.containsKey("GREEN"));
        assertEquals("#00FF00", test.get("GREEN"));
View Full Code Here

            // special implementation to handle disappearing entries
            ArrayList list = new ArrayList();
            Iterator iterator = iterator();
            while (iterator.hasNext()) {
                Entry e = (Entry) iterator.next();
                list.add(new DefaultMapEntry(e.getKey(), e.getValue()));
            }
            return list.toArray(arr);
        }
View Full Code Here

            public Object[] toArray(Object[] arr) {
                ArrayList list = new ArrayList();
                Iterator iterator = iterator();
                while (iterator.hasNext()) {
                    Entry e = (Entry)iterator.next();
                    list.add(new DefaultMapEntry(e.getKey(), e.getValue()));
                }
                return list.toArray(arr);
            }
        };
        return entrySet;
View Full Code Here

    public void testMaskedProperties()
    {
        // test nulls
        assertNull(PropertiesUtils.maskedPropertyValue(null));
        assertNull(PropertiesUtils.maskedPropertyValue(new DefaultMapEntry(null, "value")));
        assertNull(PropertiesUtils.maskedPropertyValue(new DefaultMapEntry("key", null)));

        // try non-masked value
        Map.Entry property = new DefaultMapEntry("secretname", "secret");
        assertTrue("secret".equals(PropertiesUtils.maskedPropertyValue(property)));

        // now mask value
        PropertiesUtils.registerMaskedPropertyName("secretname");
        String masked = PropertiesUtils.maskedPropertyValue(property);
View Full Code Here

        Enumeration enumeration = qq_baseSession.getAttributeNames();
        while( enumeration.hasMoreElements() ) {
            String name = (String)enumeration.nextElement();
            if (name.equalsIgnoreCase(attributeName)) {
                Object result = qq_baseSession.getAttribute(name);
                return new DefaultMapEntry(name, result);
            }
        }
        return null;
    }
View Full Code Here

        Enumeration enumeration = qq_baseSession.getAttributeNames();
        while( enumeration.hasMoreElements() ) {
            String name = (String)enumeration.nextElement();
            if (name.equalsIgnoreCase(attributeName)) {
                Object result = qq_baseSession.getAttribute(name);
                return new DefaultMapEntry(name, result);
            }
        }
        return null;
    }
View Full Code Here

        user = userDAO.save(user);

        final PropagationByResource propByRes = new PropagationByResource();
        propByRes.set(PropagationOperation.CREATE, user.getResourceNames());

        return new WorkflowResult<Map.Entry<Long, Boolean>>(new DefaultMapEntry(user.getId(), propagate_enable),
                propByRes, "create");
    }
View Full Code Here

        PropagationByResource propByRes = dataBinder.update(user, userMod);

        SyncopeUser updated = userDAO.save(user);

        return new WorkflowResult<Map.Entry<Long, Boolean>>(new DefaultMapEntry(updated.getId(), true), propByRes,
                "update");
    }
View Full Code Here

            public Object[] toArray(Object[] arr) {
                ArrayList list = new ArrayList();
                Iterator iterator = iterator();
                while (iterator.hasNext()) {
                    Entry e = (Entry)iterator.next();
                    list.add(new DefaultMapEntry(e.getKey(), e.getValue()));
                }
                return list.toArray(arr);
            }
        };
        return entrySet;
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.keyvalue.DefaultMapEntry

Copyright © 2018 www.massapicom. 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.