EMMA Coverage Report (generated Fri Aug 26 14:14:05 EDT 2011)
[all classes][org.jclouds.vcloud.functions]

COVERAGE SUMMARY FOR SOURCE FILE [AllCatalogItemsInOrg.java]

nameclass, %method, %block, %line, %
AllCatalogItemsInOrg.java0%   (0/2)0%   (0/5)0%   (0/40)0%   (0/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AllCatalogItemsInOrg0%   (0/1)0%   (0/3)0%   (0/27)0%   (0/7)
AllCatalogItemsInOrg (Function, Function): void 0%   (0/1)0%   (0/12)0%   (0/5)
access$000 (AllCatalogItemsInOrg): Function 0%   (0/1)0%   (0/3)0%   (0/1)
apply (Org): Iterable 0%   (0/1)0%   (0/12)0%   (0/1)
     
class AllCatalogItemsInOrg$10%   (0/1)0%   (0/2)0%   (0/13)0%   (0/2)
AllCatalogItemsInOrg$1 (AllCatalogItemsInOrg): void 0%   (0/1)0%   (0/6)0%   (0/1)
apply (Catalog): Iterable 0%   (0/1)0%   (0/7)0%   (0/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.vcloud.functions;
20 
21import javax.annotation.Resource;
22import javax.inject.Inject;
23import javax.inject.Singleton;
24 
25import org.jclouds.logging.Logger;
26import org.jclouds.vcloud.domain.Catalog;
27import org.jclouds.vcloud.domain.CatalogItem;
28import org.jclouds.vcloud.domain.Org;
29 
30import com.google.common.base.Function;
31import com.google.common.collect.Iterables;
32 
33/**
34 * @author Adrian Cole
35 */
36@Singleton
37public class AllCatalogItemsInOrg implements Function<Org, Iterable<? extends CatalogItem>> {
38 
39   @Resource
40   public Logger logger = Logger.NULL;
41 
42   private final Function<Org, Iterable<? extends Catalog>> allCatalogsInOrg;
43 
44   private final Function<Catalog, Iterable<? extends CatalogItem>> allCatalogItemsInCatalog;
45 
46   @Inject
47   AllCatalogItemsInOrg(Function<Org, Iterable<? extends Catalog>> allCatalogsInOrg,
48            Function<Catalog, Iterable<? extends CatalogItem>> allCatalogItemsInCatalog) {
49      this.allCatalogsInOrg = allCatalogsInOrg;
50      this.allCatalogItemsInCatalog = allCatalogItemsInCatalog;
51   }
52 
53   @Override
54   public Iterable<? extends CatalogItem> apply(Org from) {
55      return Iterables.concat(Iterables.transform(allCatalogsInOrg.apply(from),
56               new Function<Catalog, Iterable<? extends CatalogItem>>() {
57                  @Override
58                  public Iterable<? extends CatalogItem> apply(Catalog from) {
59                     return allCatalogItemsInCatalog.apply(from);
60                  }
61 
62               }));
63   }
64}

[all classes][org.jclouds.vcloud.functions]
EMMA 2.0.5312 (C) Vladimir Roubtsov