public static List<AclEntryProto> convertAclEntryProto( List<AclEntry> aclSpec) { ArrayList<AclEntryProto> r = Lists.newArrayListWithCapacity(aclSpec.size()); for (AclEntry e : aclSpec) { AclEntryProto.Builder builder = AclEntryProto.newBuilder(); builder.setType(convert(e.getType())); builder.setScope(convert(e.getScope())); builder.setPermissions(convert(e.getPermission())); if (e.getName() != null) { builder.setName(e.getName()); } r.add(builder.build()); } return r; }
public static List<AclEntry> convertAclEntry(List<AclEntryProto> aclSpec) { ArrayList<AclEntry> r = Lists.newArrayListWithCapacity(aclSpec.size()); for (AclEntryProto e : aclSpec) { AclEntry.Builder builder = new AclEntry.Builder(); builder.setType(convert(e.getType())); builder.setScope(convert(e.getScope())); builder.setPermission(convert(e.getPermissions())); if (e.hasName()) { builder.setName(e.getName()); } r.add(builder.build()); } return r; }