Code example for Function

Methods: apply

0
   @Override 
   public Hardware apply(VApp from) {
      checkNotNull(from, "VApp");
      try { 
         HardwareBuilder builder = rasdToHardwareBuilder.apply(from.getResourceAllocations());
         builder.location(findLocationForResource.apply(checkNotNull(from, "from").getVDC()));
         builder.ids(from.getHref().toASCIIString()).name(from.getName())
               .supportsImage(ImagePredicates.idEquals(from.getHref().toASCIIString()));
         builder.hypervisor("VMware");
         return builder.build();
      } catch (NoSuchElementException e) {
         logger.debug("incomplete data to form vApp %s", from.getHref());
         return null; 
      } 
   } 
}