@Test public void testToMap() throws AmbariException { KerberosKeytabDescriptor descriptor = createFromMap(); Assert.assertNotNull(descriptor); Assert.assertEquals(MAP_VALUE, descriptor.toMap()); }
@Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<String, Object>(); String data; data = getFile(); map.put("file", data); Map<String, String> owner = new TreeMap<String, String>(); data = getOwnerName(); if (data != null) { owner.put("name", data); } data = getOwnerAccess(); if (data != null) { owner.put("access", data); } if (!owner.isEmpty()) { map.put("owner", owner); } Map<String, String> group = new TreeMap<String, String>(); data = getGroupName(); if (data != null) { group.put("name", data); } data = getGroupAccess(); if (data != null) { group.put("access", data); } if (!owner.isEmpty()) { map.put("group", group); } data = getConfiguration(); if (data != null) { map.put("configuration", data); } return map; }
KerberosKeytabDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<String, Object>(); String data; data = getFile(); map.put("file", data); Map<String, String> owner = new TreeMap<String, String>(); data = getOwnerName(); if (data != null) { owner.put("name", data); } data = getOwnerAccess(); if (data != null) { owner.put("access", data); } if (!owner.isEmpty()) { map.put("owner", owner); } Map<String, String> group = new TreeMap<String, String>(); data = getGroupName(); if (data != null) { group.put("name", data); } data = getGroupAccess(); if (data != null) { group.put("access", data); } if (!owner.isEmpty()) { map.put("group", group); } data = getConfiguration(); if (data != null) { map.put("configuration", data); } return map; } }
KerberosKeytabDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<String, Object>(); String data; data = getFile(); map.put("file", data); Map<String, String> owner = new TreeMap<String, String>(); data = getOwnerName(); if (data != null) { owner.put("name", data); } data = getOwnerAccess(); if (data != null) { owner.put("access", data); } if (!owner.isEmpty()) { map.put("owner", owner); } Map<String, String> group = new TreeMap<String, String>(); data = getGroupName(); if (data != null) { group.put("name", data); } data = getGroupAccess(); if (data != null) { group.put("access", data); } if (!owner.isEmpty()) { map.put("group", group); } data = getConfiguration(); if (data != null) { map.put("configuration", data); } return map; } KerberosKeytabDescriptor(String file, String ownerName, String ownerAccess, String groupName,
                                  String groupAccess, String configuration, boolean cachable);  KerberosKeytabDescriptor(Map<?, ?> data); }
KerberosKeytabDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<String, Object>(); String data; data = getFile(); map.put("file", data); Map<String, String> owner = new TreeMap<String, String>(); data = getOwnerName(); if (data != null) { owner.put("name", data); } data = getOwnerAccess(); if (data != null) { owner.put("access", data); } if (!owner.isEmpty()) { map.put("owner", owner); } Map<String, String> group = new TreeMap<String, String>(); data = getGroupName(); if (data != null) { group.put("name", data); } data = getGroupAccess(); if (data != null) { group.put("access", data); } if (!owner.isEmpty()) { map.put("group", group); } data = getConfiguration(); if (data != null) { map.put("configuration", data); } return map; } KerberosKeytabDescriptor(String file, String ownerName, String ownerAccess, String groupName,
                                  String groupAccess, String configuration, boolean cachable);  KerberosKeytabDescriptor(Map<?, ?> data); String getFile(); void setFile(String file); String getOwnerName(); void setOwnerName(String name); String getOwnerAccess(); void setOwnerAccess(String access); String getGroupName(); void setGroupName(String name); String getGroupAccess(); void setGroupAccess(String access); String getConfiguration(); void setConfiguration(String configuration); boolean isCachable(); void setCachable(boolean cachable); void update(KerberosKeytabDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object); }
KerberosKeytabDescriptor extends AbstractKerberosDescriptor { @Override public Map<String, Object> toMap() { Map<String, Object> map = new TreeMap<String, Object>(); String data; data = getFile(); map.put("file", data); Map<String, String> owner = new TreeMap<String, String>(); data = getOwnerName(); if (data != null) { owner.put("name", data); } data = getOwnerAccess(); if (data != null) { owner.put("access", data); } if (!owner.isEmpty()) { map.put("owner", owner); } Map<String, String> group = new TreeMap<String, String>(); data = getGroupName(); if (data != null) { group.put("name", data); } data = getGroupAccess(); if (data != null) { group.put("access", data); } if (!owner.isEmpty()) { map.put("group", group); } data = getConfiguration(); if (data != null) { map.put("configuration", data); } return map; } KerberosKeytabDescriptor(String file, String ownerName, String ownerAccess, String groupName,
                                  String groupAccess, String configuration, boolean cachable);  KerberosKeytabDescriptor(Map<?, ?> data); String getFile(); void setFile(String file); String getOwnerName(); void setOwnerName(String name); String getOwnerAccess(); void setOwnerAccess(String access); String getGroupName(); void setGroupName(String name); String getGroupAccess(); void setGroupAccess(String access); String getConfiguration(); void setConfiguration(String configuration); boolean isCachable(); void setCachable(boolean cachable); void update(KerberosKeytabDescriptor updates); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object object);  }