@Override public Image apply(Template template) { checkNotNull(template, "template"); OperatingSystem os = templateToOperatingSystem.apply(template); ImageBuilder builder = new ImageBuilder().ids(template.getId() + "").name(template.getName()) .description(template.getDisplayText()).operatingSystem(os); if (!template.isCrossZones()) builder.location(FluentIterable.from(locations.get()).firstMatch(idEquals(template.getZoneId())).orNull()); //TODO: implement status mapping!!! builder.status(Status.AVAILABLE); return builder.build(); } }
@Override public Image apply(Template template) { checkNotNull(template, "template"); OperatingSystem os = templateToOperatingSystem.apply(template); ImageBuilder builder = new ImageBuilder().ids(template.getId() + "").name(template.getName()) .description(template.getDisplayText()).operatingSystem(os); if (!template.isCrossZones()) builder.location(FluentIterable.from(locations.get()).firstMatch(idEquals(template.getZoneId())).orNull()); //TODO: implement status mapping!!! builder.status(Status.AVAILABLE); return builder.build(); } }
@Override public Image apply(Template template) { checkNotNull(template, "template"); OperatingSystem os = templateToOperatingSystem.apply(template); ImageBuilder builder = new ImageBuilder().ids(template.getId() + "").name(template.getName()) .description(template.getDisplayText()).operatingSystem(os); if (!template.isCrossZones()) builder.location(FluentIterable.from(locations.get()).firstMatch(idEquals(template.getZoneId())).orNull()); //TODO: implement status mapping!!! builder.status(Status.AVAILABLE); return builder.build(); } }
assert template.getId() != null : template; assert template.getName() != null : template; assert template.getDisplayText() != null : template; assert template.getCreated() != null : template; assert template.getFormat() != null && template.getFormat() != Template.Format.UNRECOGNIZED : template;
assert template.getId() != null : template; assert template.getName() != null : template; assert template.getDisplayText() != null : template; assert template.getCreated() != null : template; assert template.getFormat() != null && template.getFormat() != Template.Format.UNRECOGNIZED : template;
public T fromTemplate(Template in) { return this .id(in.getId()) .displayText(in.getDisplayText()) .domain(in.getDomain()) .domainId(in.getDomainId())
public T fromTemplate(Template in) { return this .id(in.getId()) .displayText(in.getDisplayText()) .domain(in.getDomain()) .domainId(in.getDomainId())
public T fromTemplate(Template in) { return this .id(in.getId()) .displayText(in.getDisplayText()) .domain(in.getDomain()) .domainId(in.getDomainId())