public static Map<String, Object> asMap(List<DynamicProperty> propSet) { Map<String, Object> result = new HashMap<String, Object>(); for (DynamicProperty prop : propSet) { result.put(prop.getName(), prop.getVal()); } return result; }
private ManagedObjectReference getParent(ObjectContent cont) { for (DynamicProperty dp : cont.getPropSet()) { if (dp.getName().equals("parent")) { return (ManagedObjectReference) dp.getVal(); } } // root object return null; }
public static Object getDynamicProperty(ObjectContent objectContent, String name) { for (DynamicProperty prop : objectContent.getPropSet()) { if (name.equals(prop.getName())) { return prop.getVal(); } } return null; } }
@SuppressWarnings("unchecked") private <T> T prop(ObjectContent oc, String prop) { for (DynamicProperty dp : oc.getPropSet()) { if (prop.equals(dp.getName())) { return (T) dp.getVal(); } } return null; }
private String getName(ObjectContent oc) throws FinderException { for (DynamicProperty dp : oc.getPropSet()) { if (dp.getName().equals("name")) { return (String) dp.getVal(); } } throw new FinderException("No name fetched for " + oc.getObj()); } }
private String getName(ObjectContent cont) throws FinderException { for (DynamicProperty dp : cont.getPropSet()) { if (dp.getName().equals("name")) { return (String) dp.getVal(); } } // probably bad spec throw new FinderException("Name property not found/fetched for " + cont.getObj().getType()); }
if (dps != null) { for (DynamicProperty dp : dps) { propMap.put(dp.getName(), dp.getVal());
if (properties[p].equals(dp.getName())) { ret[p] = dp.getVal();
if (dps != null) { for (DynamicProperty dp : dps) { propMap.put(dp.getName(), dp.getVal());
List<DynamicProperty> dps = oc.getPropSet(); for (DynamicProperty dp : dps) { retVal.put(dp.getName(), dp.getVal());
List<DynamicProperty> dps = oc.getPropSet(); for (DynamicProperty dp : dps) { retVal.put(dp.getName(), dp.getVal());
pTables[index].put(props[j].getName(), obj);