@Test public void testToMap() throws AmbariException { Gson gson = new Gson(); KerberosServiceDescriptor descriptor = createFromMap(); Assert.assertNotNull(descriptor); Assert.assertEquals(gson.toJson(MAP_VALUE), gson.toJson(descriptor.toMap())); }
@Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (components != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosComponentDescriptor component : components.values()) { list.add(component.toMap()); } map.put(Type.COMPONENT.getDescriptorPluralName(), list); } return map; }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (components != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosComponentDescriptor component : components.values()) { list.add(component.toMap()); } map.put(Type.COMPONENT.getDescriptorPluralName(), list); } return map; } }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (components != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosComponentDescriptor component : components.values()) { list.add(component.toMap()); } map.put(Type.COMPONENT.getDescriptorPluralName(), list); } return map; } KerberosServiceDescriptor(Map<?, ?> data);   KerberosServiceDescriptor(String name, Map<?, ?> data); }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (components != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosComponentDescriptor component : components.values()) { list.add(component.toMap()); } map.put(Type.COMPONENT.getDescriptorPluralName(), list); } return map; } KerberosServiceDescriptor(Map<?, ?> data);   KerberosServiceDescriptor(String name, Map<?, ?> data); @Override Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers(); @Override AbstractKerberosDescriptorContainer getChildContainer(String name); Map<String, KerberosComponentDescriptor> getComponents(); KerberosComponentDescriptor getComponent(String name); void putComponent(KerberosComponentDescriptor component); void update(KerberosServiceDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object); }
KerberosServiceDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (components != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosComponentDescriptor component : components.values()) { list.add(component.toMap()); } map.put(Type.COMPONENT.getDescriptorPluralName(), list); } return map; } KerberosServiceDescriptor(Map<?, ?> data);   KerberosServiceDescriptor(String name, Map<?, ?> data); @Override Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers(); @Override AbstractKerberosDescriptorContainer getChildContainer(String name); Map<String, KerberosComponentDescriptor> getComponents(); KerberosComponentDescriptor getComponent(String name); void putComponent(KerberosComponentDescriptor component); void update(KerberosServiceDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object);  }