public static VolumeFailureSummary convertVolumeFailureSummary( VolumeFailureSummaryProto proto) { List<String> failedStorageLocations = proto.getFailedStorageLocationsList(); return new VolumeFailureSummary( failedStorageLocations.toArray(new String[failedStorageLocations.size()]), proto.getLastVolumeFailureDate(), proto.getEstimatedCapacityLostTotal()); }
public static VolumeFailureSummaryProto convertVolumeFailureSummary( VolumeFailureSummary volumeFailureSummary) { VolumeFailureSummaryProto.Builder builder = VolumeFailureSummaryProto.newBuilder(); for (String failedStorageLocation: volumeFailureSummary.getFailedStorageLocations()) { builder.addFailedStorageLocations(failedStorageLocation); } builder.setLastVolumeFailureDate( volumeFailureSummary.getLastVolumeFailureDate()); builder.setEstimatedCapacityLostTotal( volumeFailureSummary.getEstimatedCapacityLostTotal()); return builder.build(); }