Examples of containsKey()


Examples of javax.management.openmbean.CompositeDataSupport.containsKey()

         itemNames, itemDescriptions, itemTypes);
      HashMap map = new HashMap();
      map.put("name1", "value1");
      map.put("name2", new Integer(2));
      CompositeDataSupport data = new CompositeDataSupport(compositeType, map);
      assertTrue("data should contain key name1", data.containsKey("name1") == true);
      assertTrue("data should contain key name2", data.containsKey("name2") == true);
      assertTrue("data should not contain key nameX", data.containsKey("nameX") == false);
      assertTrue("data should not contain key null", data.containsKey(null) == false);
      assertTrue("data should not contain key <empty>", data.containsKey("") == false);
   }
View Full Code Here

Examples of javax.management.openmbean.CompositeType.containsKey()

    private void assertTableHasHeadingsNamed(final TabularData resultsTable, String... headingNames)
    {
        CompositeType headingsRow = resultsTable.getTabularType().getRowType();
        for (final String headingName : headingNames)
        {
            assertTrue("Table should have column with heading " + headingName, headingsRow.containsKey(headingName));
        }
    }

    private Map<String, String> createTestNodeResult()
    {
View Full Code Here

Examples of javax.management.openmbean.TabularData.containsKey()

    {
        TabularData userList = _amqumMBean.viewUsers();

        assertNotNull(userList);
        assertEquals("Unexpected number of users in user list", 1, userList.size());
        assertTrue(userList.containsKey(new Object[]{TEST_USERNAME}));
       
        // Check the deprecated read, write and admin items continue to exist but return false.
        CompositeData userRec = userList.get(new Object[]{TEST_USERNAME});
        assertTrue(userRec.containsKey(UserManagement.RIGHTS_READ_ONLY));
        assertEquals(false, userRec.get(UserManagement.RIGHTS_READ_ONLY));
View Full Code Here

Examples of javax.management.openmbean.TabularDataSupport.containsKey()

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);

      TabularDataSupport data = new TabularDataSupport(tabularType);

      assertTrue("Didn't expect containsKey null", data.containsKey(null) == false);
      assertTrue("Didn't expect containsKey not an Object array", data.containsKey(new Object()) == false);

      Object[] index = new Object[] { "value1", new Integer(2) };
      assertTrue("Didn't expect containsKey on empty data", data.containsKey((Object) index) == false);
View Full Code Here

Examples of javax.print.attribute.HashAttributeSet.containsKey()

        harness.check(true);
      }

    harness.check(testSet.remove((Attribute) null), false);
    harness.check(testSet.remove((Class) null), false);
    harness.check(testSet.containsKey(null), false);
    harness.check(testSet.containsValue(null), false);   
  }

}
View Full Code Here

Examples of javax.print.attribute.PrintRequestAttributeSet.containsKey()

            Class dstCategory = Destination.class;
            Class amCategory = SunAlternateMedia.class;
            Class fdCategory = Fidelity.class;

            if (attributes.containsKey(dstCategory) &&
                !newas.containsKey(dstCategory))
            {
                attributes.remove(dstCategory);
            }

            if (attributes.containsKey(amCategory) &&
View Full Code Here

Examples of javax.print.attribute.PrintServiceAttributeSet.containsKey()

    public PrintServiceAttribute getAttribute(Class category) {
        if (!PrintServiceAttribute.class.isAssignableFrom(category)) {
            throw new IllegalArgumentException();
        }
        PrintServiceAttributeSet attributes = getAttributes();
        if (attributes.containsKey(category)) {
            PrintServiceAttribute attribute = (PrintServiceAttribute) attributes
                    .get(category);
            return attribute;
        }
        return null;
View Full Code Here

Examples of javax.print.attribute.standard.PrinterStateReasons.containsKey()

            if (prnState == PrinterState.STOPPED) {
                PrinterStateReasons prnStateReasons =
                    (PrinterStateReasons)service.getAttribute(
                                                 PrinterStateReasons.class);
                if ((prnStateReasons != null) &&
                    (prnStateReasons.containsKey(PrinterStateReason.SHUTDOWN)))
                {
                    throw new PrinterException("PrintService is no longer available.");
                }
            }
View Full Code Here

Examples of javax.script.Bindings.containsKey()

        }
        bindings.put(LOG, logObject);

        // copy non-base variables
        for (Map.Entry<String, Object> entry : slingBindings.entrySet()) {
            if (!bindings.containsKey(entry.getKey())) {
                bindings.put(entry.getKey(), entry.getValue());
            }
        }

        if (!bindingsValuesProviders.isEmpty()) {
View Full Code Here

Examples of javax.script.SimpleBindings.containsKey()

        }
        bindings.put(LOG, logObject);

        // copy non-base variables
        for (Map.Entry<String, Object> entry : slingBindings.entrySet()) {
            if (!bindings.containsKey(entry.getKey())) {
                bindings.put(entry.getKey(), entry.getValue());
            }
        }

        if (!bindingsValuesProviders.isEmpty()) {
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.