Code example for Function

Methods: apply

0
      String[] parts = AWSUtils.parseHandle(id);
      String region = parts[0];
      String instanceId = parts[1];
      try { 
         Image image = getImageInRegion(region, instanceId);
         return imageToImage.apply(image);
      } catch (NoSuchElementException e) {
         return null; 
      } 
   } 
 
   public Image getImageInRegion(String region, String id) {
      return getOnlyElement(client.getAMIApi().get().describeImagesInRegion(region,
               DescribeImagesOptions.Builder.imageIds(id)));
   } 
 
}