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

COVERAGE SUMMARY FOR SOURCE FILE [TransitionOnAction.java]

nameclass, %method, %block, %line, %
TransitionOnAction.java100% (1/1)67%  (4/6)78%  (89/114)66%  (17.8/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TransitionOnAction100% (1/1)67%  (4/6)78%  (89/114)66%  (17.8/27)
getAction (): Instance$Action 0%   (0/1)0%   (0/3)0%   (0/1)
getTo (): Instance$State 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 100% (1/1)66%  (29/44)53%  (8/15)
hashCode (): int 100% (1/1)88%  (28/32)96%  (4.8/5)
TransitionOnAction (Instance$Action, Instance$State): void 100% (1/1)100% (15/15)100% (4/4)
toString (): String 100% (1/1)100% (17/17)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.deltacloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23/**
24 * 
25 * @author Adrian Cole
26 */
27public class TransitionOnAction implements Transition {
28   private final Instance.Action action;
29   private final Instance.State to;
30 
31   public TransitionOnAction(Instance.Action action, Instance.State to) {
32      this.to = checkNotNull(to, "to");
33      this.action = checkNotNull(action, "action");
34   }
35 
36   public Instance.State getTo() {
37      return to;
38   }
39 
40   public Instance.Action getAction() {
41      return action;
42   }
43 
44   @Override
45   public String toString() {
46      return "[action=" + action + ", to=" + to + "]";
47   }
48 
49   @Override
50   public int hashCode() {
51      final int prime = 31;
52      int result = 1;
53      result = prime * result + ((action == null) ? 0 : action.hashCode());
54      result = prime * result + ((to == null) ? 0 : to.hashCode());
55      return result;
56   }
57 
58   @Override
59   public boolean equals(Object obj) {
60      if (this == obj)
61         return true;
62      if (obj == null)
63         return false;
64      if (getClass() != obj.getClass())
65         return false;
66      TransitionOnAction other = (TransitionOnAction) obj;
67      if (action == null) {
68         if (other.action != null)
69            return false;
70      } else if (!action.equals(other.action))
71         return false;
72      if (to != other.to)
73         return false;
74      return true;
75   }
76}

[all classes][org.jclouds.deltacloud.domain]
EMMA 2.0.5312 (C) Vladimir Roubtsov