private boolean checkForMapValue(TabularType pType) { CompositeType rowType = pType.getRowType(); // Two entries in the row: "key" and "value" return rowType.containsKey(TD_KEY_VALUE) && rowType.containsKey(TD_KEY_KEY) && rowType.keySet().size() == 2; }
/** * Check whether the given tabular type represents a MXBean map. See the * {@link javax.management.MXBean} specification for * details how a map is converted to {@link TabularData} by the MXBean framework. * * @param pType type of tabular data to convert * @return true if this type represents an MXBean map, false otherwise. */ private boolean checkForMxBeanMap(TabularType pType) { CompositeType rowType = pType.getRowType(); return rowType.containsKey("key") && rowType.containsKey("value") && rowType.keySet().size() == 2 // Only convert to map for simple types for all others use normal conversion. See #105 for details. && rowType.getType("key") instanceof SimpleType; }
private void fillCompositeWithGivenValues(CompositeType pType, Map<String, Object> pCompositeValues, Map<String, Object> pSourceJson) { for (Map.Entry<String,Object> entry : pSourceJson.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (!pType.containsKey(key)) { throw new IllegalArgumentException( "Conversion to CompositeType failed because " + key + " is not known as composite attribute key."); } if (value != null) { Object convertedValue = getDispatcher().convertToObject(pType.getType(key),value); pCompositeValues.put(key, convertedValue); } } }
private boolean checkForMapValue(TabularType pType) { CompositeType rowType = pType.getRowType(); // Two entries in the row: "key" and "value" return rowType.containsKey(TD_KEY_VALUE) && rowType.containsKey(TD_KEY_KEY) && rowType.keySet().size() == 2; }
private boolean checkForMapValue(TabularType pType) { CompositeType rowType = pType.getRowType(); // Two entries in the row: "key" and "value" return rowType.containsKey(TD_KEY_VALUE) && rowType.containsKey(TD_KEY_KEY) && rowType.keySet().size() == 2; }
private boolean checkForMapValue(TabularType pType) { CompositeType rowType = pType.getRowType(); // Two entries in the row: "key" and "value" return rowType.containsKey(TD_KEY_VALUE) && rowType.containsKey(TD_KEY_KEY) && rowType.keySet().size() == 2; }
/** * Check whether the given tabular type represents a MXBean map. See the * {@link javax.management.MXBean} specification for * details how a map is converted to {@link TabularData} by the MXBean framework. * * @param pType type of tabular data to convert * @return true if this type represents an MXBean map, false otherwise. */ private boolean checkForMxBeanMap(TabularType pType) { CompositeType rowType = pType.getRowType(); return rowType.containsKey("key") && rowType.containsKey("value") && rowType.keySet().size() == 2 // Only convert to map for simple types for all others use normal conversion. See #105 for details. && rowType.getType("key") instanceof SimpleType; }
/** * Check whether the given tabular type represents a MXBean map. See the * {@link javax.management.MXBean} specification for * details how a map is converted to {@link TabularData} by the MXBean framework. * * @param pType type of tabular data to convert * @return true if this type represents an MXBean map, false otherwise. */ private boolean checkForMxBeanMap(TabularType pType) { CompositeType rowType = pType.getRowType(); return rowType.containsKey("key") && rowType.containsKey("value") && rowType.keySet().size() == 2 // Only convert to map for simple types for all others use normal conversion. See #105 for details. && rowType.getType("key") instanceof SimpleType; }
/** * Check whether the given tabular type represents a MXBean map. See the * {@link javax.management.MXBean} specification for * details how a map is converted to {@link TabularData} by the MXBean framework. * * @param pType type of tabular data to convert * @return true if this type represents an MXBean map, false otherwise. */ private boolean checkForMxBeanMap(TabularType pType) { CompositeType rowType = pType.getRowType(); return rowType.containsKey("key") && rowType.containsKey("value") && rowType.keySet().size() == 2 // Only convert to map for simple types for all others use normal conversion. See #105 for details. && rowType.getType("key") instanceof SimpleType; }
private void fillCompositeWithGivenValues(CompositeType pType, Map<String, Object> pCompositeValues, Map<String, Object> pSourceJson) { for (Map.Entry<String,Object> entry : pSourceJson.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (!pType.containsKey(key)) { throw new IllegalArgumentException( "Conversion to CompositeType failed because " + key + " is not known as composite attribute key."); } if (value != null) { Object convertedValue = getDispatcher().convertToObject(pType.getType(key),value); pCompositeValues.put(key, convertedValue); } } }
private void fillCompositeWithGivenValues(CompositeType pType, Map<String, Object> pCompositeValues, Map<String, Object> pSourceJson) { for (Map.Entry<String,Object> entry : pSourceJson.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (!pType.containsKey(key)) { throw new IllegalArgumentException( "Conversion to CompositeType failed because " + key + " is not known as composite attribute key."); } if (value != null) { Object convertedValue = getDispatcher().deserialize(pType.getType(key), value); pCompositeValues.put(key, convertedValue); } } }
private void fillCompositeWithGivenValues(CompositeType pType, Map<String, Object> pCompositeValues, Map<String, Object> pSourceJson) { for (Map.Entry<String,Object> entry : pSourceJson.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (!pType.containsKey(key)) { throw new IllegalArgumentException( "Conversion to CompositeType failed because " + key + " is not known as composite attribute key."); } if (value != null) { Object convertedValue = getDispatcher().convertToObject(pType.getType(key),value); pCompositeValues.put(key, convertedValue); } } }