@Override Image toPb() { Image.RawDisk rawDiskPb = new Image.RawDisk(); rawDiskPb.setSource(source); rawDiskPb.setSha1Checksum(sha1); if (containerType != null) { rawDiskPb.setContainerType(containerType.name()); } Image imagePb = super.toPb(); return imagePb.setRawDisk(rawDiskPb); }
private Builder(Image imagePb) { super(Type.STORAGE, imagePb); if (imagePb.getRawDisk().getContainerType() != null) { this.containerType = ContainerType.valueOf(imagePb.getRawDisk().getContainerType()); } this.sha1 = imagePb.getRawDisk().getSha1Checksum(); this.source = imagePb.getRawDisk().getSource(); }
private Builder(Image imagePb) { super(Type.STORAGE, imagePb); if (imagePb.getRawDisk().getContainerType() != null) { this.containerType = ContainerType.valueOf(imagePb.getRawDisk().getContainerType()); } this.sha1 = imagePb.getRawDisk().getSha1Checksum(); this.source = imagePb.getRawDisk().getSource(); }
@Override Image toPb() { Image.RawDisk rawDiskPb = new Image.RawDisk(); rawDiskPb.setSource(source); rawDiskPb.setSha1Checksum(sha1); if (containerType != null) { rawDiskPb.setContainerType(containerType.name()); } Image imagePb = super.toPb(); return imagePb.setRawDisk(rawDiskPb); }