public T fromProductItem(ProductItem in) { return this.id(in.getId()) .description(in.getDescription()) .units(in.getUnits()) .capacity(in.getCapacity()) .prices(in.getPrices()) .categories(in.getCategories()); }
@Override @Consumes(MediaType.APPLICATION_JSON) public ContainerVirtualGuestConfiguration expected() { return ContainerVirtualGuestConfiguration.builder() .blockDevices( ContainerVirtualGuestConfigurationOption.builder() .productItemPrice( ProductItemPrice.builder() .hourlyRecurringFee(0) .recurringFee("0") .item(ProductItem.builder().description("25 GB (SAN)").build()) .build()) .template( VirtualGuest.builder() .blockDevices( VirtualGuestBlockDevice.builder() .device("0") .diskImage(VirtualDiskImage.builder().capacity(25).build()) .build()) .localDiskFlag(false) .build()) .build()) .datacenters( ContainerVirtualGuestConfigurationOption.builder() .template( VirtualGuest.builder() .datacenter(Datacenter.builder().name("ams01").build()) .build()) .build()) .memory( ContainerVirtualGuestConfigurationOption.builder() .productItemPrice( ProductItemPrice.builder() .hourlyRecurringFee(.02f) .recurringFee("14") .item(ProductItem.builder().description("1 GB").build()) .build()) .template(VirtualGuest.builder().maxMemory(1024).build()) .build()) .networkComponents( ContainerVirtualGuestConfigurationOption.builder() .productItemPrice( ProductItemPrice.builder() .hourlyRecurringFee(0) .recurringFee("0") .item( ProductItem.builder() .description("10 Mbps Public & Private Networks") .build()) .build()) .template( VirtualGuest.builder() .networkComponents( VirtualGuestNetworkComponent.builder().maxSpeed(10).build()) .build()) .build()) .operatingSystems( ContainerVirtualGuestConfigurationOption.builder() .productItemPrice( ProductItemPrice.builder() .hourlyRecurringFee(0) .recurringFee("0") .item( ProductItem.builder() .description("CentOS 6.x - Minimal Install (64 bit)") .build()) .build()) .template( VirtualGuest.builder().operatingSystemReferenceCode("CENTOS_6_64").build()) .build()) .processors( ContainerVirtualGuestConfigurationOption.builder() .productItemPrice( ProductItemPrice.builder() .hourlyRecurringFee(.022f) .recurringFee("15") .item(ProductItem.builder().description("1 x 2.0 GHz Core").build()) .build()) .template(VirtualGuest.builder().startCpus(1).build()) .build()) .build(); }