class JsonUtil {

  public static AclStatus toAclStatus(final Map<?, ?> json) {
    if (json == null) {
      return null;
    }

    final Map<?, ?> m = (Map<?, ?>) json.get(AclStatus.class.getSimpleName());

    AclStatus.Builder aclStatusBuilder = new AclStatus.Builder();
    aclStatusBuilder.owner((String) m.get("owner"));
    aclStatusBuilder.group((String) m.get("group"));
    aclStatusBuilder.stickyBit((Boolean) m.get("stickyBit"));

    final Object[] entries = (Object[]) m.get("entries");

    List<AclEntry> aclEntryList = new ArrayList<AclEntry>();
    for (int i = 0; i < entries.length; i++) {
      AclEntry aclEntry = AclEntry.parseAclEntry((String) entries[i], true);
      aclEntryList.add(aclEntry);
    }
    aclStatusBuilder.addEntries(aclEntryList);
    return aclStatusBuilder.build();
  }

}