@Test public void testToMap() throws AmbariException { Gson gson = new Gson(); KerberosDescriptor 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 (services != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosServiceDescriptor service : services.values()) { list.add(service.toMap()); } map.put(Type.SERVICE.getDescriptorPluralName(), list); } if (properties != null) { map.put("properties", new TreeMap<String, String>(properties)); } return map; }
KerberosDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (services != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosServiceDescriptor service : services.values()) { list.add(service.toMap()); } map.put(Type.SERVICE.getDescriptorPluralName(), list); } if (properties != null) { map.put("properties", new TreeMap<String, String>(properties)); } return map; } }
KerberosDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (services != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosServiceDescriptor service : services.values()) { list.add(service.toMap()); } map.put(Type.SERVICE.getDescriptorPluralName(), list); } if (properties != null) { map.put("properties", new TreeMap<String, String>(properties)); } return map; } KerberosDescriptor();   KerberosDescriptor(Map<?, ?> data); }
KerberosDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (services != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosServiceDescriptor service : services.values()) { list.add(service.toMap()); } map.put(Type.SERVICE.getDescriptorPluralName(), list); } if (properties != null) { map.put("properties", new TreeMap<String, String>(properties)); } return map; } KerberosDescriptor();   KerberosDescriptor(Map<?, ?> data); @Override Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers(); @Override AbstractKerberosDescriptorContainer getChildContainer(String name); void setServices(Map<String, KerberosServiceDescriptor> services); Map<String, KerberosServiceDescriptor> getServices(); KerberosServiceDescriptor getService(String name); void putService(KerberosServiceDescriptor service); void setProperties(Map<String, String> properties); Map<String, String> getProperties(); String getProperty(String name); void putProperty(String name, String value); void update(KerberosDescriptor updates); @Override Map<String, Object> toMap(); @Override void setParent(AbstractKerberosDescriptor parent); @Override int hashCode(); @Override boolean equals(Object object); Set<String> getAllAuthToLocalProperties(); }
KerberosDescriptor extends AbstractKerberosDescriptorContainer { @Override public Map<String, Object> toMap() { Map<String, Object> map = super.toMap(); if (services != null) { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); for (KerberosServiceDescriptor service : services.values()) { list.add(service.toMap()); } map.put(Type.SERVICE.getDescriptorPluralName(), list); } if (properties != null) { map.put("properties", new TreeMap<String, String>(properties)); } return map; } KerberosDescriptor();   KerberosDescriptor(Map<?, ?> data); @Override Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers(); @Override AbstractKerberosDescriptorContainer getChildContainer(String name); void setServices(Map<String, KerberosServiceDescriptor> services); Map<String, KerberosServiceDescriptor> getServices(); KerberosServiceDescriptor getService(String name); void putService(KerberosServiceDescriptor service); void setProperties(Map<String, String> properties); Map<String, String> getProperties(); String getProperty(String name); void putProperty(String name, String value); void update(KerberosDescriptor updates); @Override Map<String, Object> toMap(); @Override void setParent(AbstractKerberosDescriptor parent); @Override int hashCode(); @Override boolean equals(Object object); Set<String> getAllAuthToLocalProperties();  }