@Test public void testStorageToVolume() { Storage storage = Storage.builder() .id("qswdefrg-qaws-qaws-defe-rgrgdsvcxbrh") .size(40) .name("hdd-1") .busType(Storage.BusType.VIRTIO) .bootDevice(true) .deviceNumber(1) .build(); Volume actual = fnVolume.apply(storage); Volume expected = new VolumeBuilder() .id(storage.id()) .size(40f) .bootDevice(true) .device("1") .type(Volume.Type.LOCAL) .durable(true) .build(); assertEquals(actual, expected); }
@Override public Volume apply(Storage storage) { checkNotNull(storage, "Null storage"); String device = ""; if (storage.deviceNumber() != null) device = storage.deviceNumber().toString(); return new VolumeBuilder() .id(storage.id()) .size(storage.size()) .bootDevice(storage.bootDevice()) .device(device) .durable(true) .type(Volume.Type.LOCAL) .build(); }
StorageToVolume implements Function<Storage, Volume> { @Override public Volume apply(Storage storage) { checkNotNull(storage, "Null storage"); String device = ""; if (storage.deviceNumber() != null) device = storage.deviceNumber().toString(); return new VolumeBuilder() .id(storage.id()) .size(storage.size()) .bootDevice(storage.bootDevice()) .device(device) .durable(true) .type(Volume.Type.LOCAL) .build(); } }
StorageToVolume implements Function<Storage, Volume> { @Override public Volume apply(Storage storage) { checkNotNull(storage, "Null storage"); String device = ""; if (storage.deviceNumber() != null) device = storage.deviceNumber().toString(); return new VolumeBuilder() .id(storage.id()) .size(storage.size()) .bootDevice(storage.bootDevice()) .device(device) .durable(true) .type(Volume.Type.LOCAL) .build(); }  }
StorageToVolume implements Function<Storage, Volume> { @Override public Volume apply(Storage storage) { checkNotNull(storage, "Null storage"); String device = ""; if (storage.deviceNumber() != null) device = storage.deviceNumber().toString(); return new VolumeBuilder() .id(storage.id()) .size(storage.size()) .bootDevice(storage.bootDevice()) .device(device) .durable(true) .type(Volume.Type.LOCAL) .build(); }  @Override Volume apply(Storage storage); }
StorageToVolume implements Function<Storage, Volume> { @Override public Volume apply(Storage storage) { checkNotNull(storage, "Null storage"); String device = ""; if (storage.deviceNumber() != null) device = storage.deviceNumber().toString(); return new VolumeBuilder() .id(storage.id()) .size(storage.size()) .bootDevice(storage.bootDevice()) .device(device) .durable(true) .type(Volume.Type.LOCAL) .build(); }  @Override Volume apply(Storage storage);  }