/** * {@inheritDoc} */ @Override public VirtualHardwareSection build() { return new VirtualHardwareSection(this); }
@Override public int hashCode() { return Objects.hashCode(super.hashCode(), type, href, links); }
@Override public ToStringHelper string() { return super.string() .add("type", type) .add("href", href) .add("links", links); }
public B fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSectionType(in) .items(in.getItems()) .transport(in.getTransport()) .system(in.getSystem()); } }
@Override public Hardware apply(VAppTemplate from) { checkNotNull(from, "VAppTemplate"); Envelope ovf = templateToEnvelope.apply(from); if (ovf.getVirtualSystem().getVirtualHardwareSections().size() > 1) { logger.warn("multiple hardware choices found. using first", ovf); } VirtualHardwareSection hardware = Iterables.get(ovf.getVirtualSystem().getVirtualHardwareSections(), 0); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); Link vdc = Iterables.find(checkNotNull(from, "from").getLinks(), LinkPredicates.typeEquals(VCloudDirectorMediaType.VDC)); if (vdc != null) { builder.location(findLocationForResource.apply(vdc)); } else { // otherwise, it could be in a public catalog, which is not assigned to a VDC } builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); }
public Builder<?> toBuilder() { return builder().fromVirtualHardwareSection(this); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VirtualHardwareSection that = VirtualHardwareSection.class.cast(obj); return super.equals(that) && equal(this.type, that.type) && equal(this.href, that.href) && equal(this.links, that.links); } }
public B fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSectionType(in) .items(in.getItems()) .transport(in.getTransport()) .system(in.getSystem()); } }
@Override public Hardware apply(VAppTemplate from) { checkNotNull(from, "VAppTemplate"); Envelope ovf = templateToEnvelope.apply(from); if (ovf.getVirtualSystem().getVirtualHardwareSections().size() > 1) { logger.warn("multiple hardware choices found. using first", ovf); } VirtualHardwareSection hardware = Iterables.get(ovf.getVirtualSystem().getVirtualHardwareSections(), 0); HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems()); Link vdc = Iterables.find(checkNotNull(from, "from").getLinks(), LinkPredicates.typeEquals(VCloudDirectorMediaType.VDC)); if (vdc != null) { builder.location(findLocationForResource.apply(vdc)); } else { // otherwise, it could be in a public catalog, which is not assigned to a VDC } builder.ids(from.getHref().toASCIIString()).name(from.getName()).supportsImage( ImagePredicates.idEquals(from.getHref().toASCIIString())); builder.hypervisor("VMware"); return builder.build(); }
public Builder<?> toBuilder() { return builder().fromVirtualHardwareSection(this); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; VirtualHardwareSection that = VirtualHardwareSection.class.cast(obj); return super.equals(that) && equal(this.type, that.type) && equal(this.href, that.href) && equal(this.links, that.links); } }
public B fromVirtualHardwareSection(VirtualHardwareSection in) { return fromSectionType(in) .items(in.getItems()) .transport(in.getTransport()) .system(in.getSystem()); } }
/** * {@inheritDoc} */ @Override public VirtualHardwareSection build() { return new VirtualHardwareSection(this); }
public Builder<?> toBuilder() { return builder().fromVirtualHardwareSection(this); }
@Override public ToStringHelper string() { return super.string() .add("type", type) .add("href", href) .add("links", links); }
@Override public int hashCode() { return Objects.hashCode(super.hashCode(), type, href, links); }
/** * {@inheritDoc} */ @Override public VirtualHardwareSection build() { return new VirtualHardwareSection(this); }