EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.cloudsigma.functions]

COVERAGE SUMMARY FOR SOURCE FILE [SplitNewlines.java]

nameclass, %method, %block, %line, %
SplitNewlines.java100% (1/1)100% (2/2)100% (19/19)100% (4/4)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SplitNewlines100% (1/1)100% (2/2)100% (19/19)100% (4/4)
SplitNewlines (ReturnStringIf2xx): void 100% (1/1)100% (6/6)100% (3/3)
apply (HttpResponse): Set 100% (1/1)100% (13/13)100% (1/1)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  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,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.cloudsigma.functions;
20 
21import static com.google.common.base.Predicates.equalTo;
22import static com.google.common.base.Predicates.not;
23import static com.google.common.collect.Iterables.filter;
24import static com.google.common.collect.Sets.newTreeSet;
25 
26import java.util.Set;
27 
28import javax.inject.Inject;
29import javax.inject.Singleton;
30 
31import org.jclouds.http.HttpResponse;
32import org.jclouds.http.functions.ReturnStringIf2xx;
33 
34import com.google.common.base.Function;
35import com.google.common.base.Splitter;
36 
37/**
38 * 
39 * @author Adrian Cole
40 */
41@Singleton
42public class SplitNewlines implements Function<HttpResponse, Set<String>> {
43   private final ReturnStringIf2xx returnStringIf200;
44 
45   @Inject
46   protected SplitNewlines(ReturnStringIf2xx returnStringIf200) {
47      this.returnStringIf200 = returnStringIf200;
48   }
49 
50   @Override
51   public Set<String> apply(HttpResponse response) {
52      return newTreeSet(filter(Splitter.on('\n').split(returnStringIf200.apply(response)), not(equalTo(""))));
53   }
54}

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