public static SnapshottableDirectoryStatus[] convert( SnapshottableDirectoryListingProto sdlp) { if (sdlp == null) return null; List<SnapshottableDirectoryStatusProto> list = sdlp .getSnapshottableDirListingList(); if (list.isEmpty()) { return new SnapshottableDirectoryStatus[0]; } else { SnapshottableDirectoryStatus[] result = new SnapshottableDirectoryStatus[list.size()]; for (int i = 0; i < list.size(); i++) { result[i] = PBHelper.convert(list.get(i)); } return result; } }
public static SnapshottableDirectoryStatus[] convert( SnapshottableDirectoryListingProto sdlp) { if (sdlp == null) return null; List<SnapshottableDirectoryStatusProto> list = sdlp .getSnapshottableDirListingList(); if (list.isEmpty()) { return new SnapshottableDirectoryStatus[0]; } else { SnapshottableDirectoryStatus[] result = new SnapshottableDirectoryStatus[list.size()]; for (int i = 0; i < list.size(); i++) { result[i] = convert(list.get(i)); } return result; } }
public static SnapshottableDirectoryListingProto convert( SnapshottableDirectoryStatus[] status) { if (status == null) return null; SnapshottableDirectoryStatusProto[] protos = new SnapshottableDirectoryStatusProto[status.length]; for (int i = 0; i < status.length; i++) { protos[i] = PBHelper.convert(status[i]); } List<SnapshottableDirectoryStatusProto> protoList = Arrays.asList(protos); return SnapshottableDirectoryListingProto.newBuilder() .addAllSnapshottableDirListing(protoList).build(); }
public static SnapshottableDirectoryListingProto convert( SnapshottableDirectoryStatus[] status) { if (status == null) return null; SnapshottableDirectoryStatusProto[] protos = new SnapshottableDirectoryStatusProto[status.length]; for (int i = 0; i < status.length; i++) { protos[i] = convert(status[i]); } List<SnapshottableDirectoryStatusProto> protoList = Arrays.asList(protos); return SnapshottableDirectoryListingProto.newBuilder() .addAllSnapshottableDirListing(protoList).build(); }