Coverage Report - org.seasar.teeda.core.config.faces.element.impl.NavigationCaseElementImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
NavigationCaseElementImpl
67%
16/24
5%
1/22
1.4
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.config.faces.element.impl;
 17  
 
 18  
 import org.seasar.teeda.core.config.faces.element.NavigationCaseElement;
 19  
 
 20  
 /**
 21  
  * @author shot
 22  
  */
 23  
 public class NavigationCaseElementImpl implements NavigationCaseElement {
 24  
 
 25  
     private String fromAction_;
 26  
 
 27  
     private String fromOutcome_;
 28  
 
 29  
     private String toViewId_;
 30  
 
 31  5
     private boolean redirect_ = false;
 32  
 
 33  5
     public NavigationCaseElementImpl() {
 34  5
     }
 35  
 
 36  
     public void setFromAction(String fromAction) {
 37  5
         fromAction_ = fromAction;
 38  5
     }
 39  
 
 40  
     public void setFromOutcome(String outcome) {
 41  4
         fromOutcome_ = outcome;
 42  4
     }
 43  
 
 44  
     public void setToViewId(String toViewId) {
 45  3
         if (toViewId == null) {
 46  0
             throw new IllegalArgumentException("toViewID");
 47  
         }
 48  3
         toViewId_ = toViewId;
 49  3
     }
 50  
 
 51  
     public void setRedirect(String dummy) {
 52  2
         redirect_ = true;
 53  2
     }
 54  
 
 55  
     public String getFromAction() {
 56  5
         return fromAction_;
 57  
     }
 58  
 
 59  
     public String getFromOutcome() {
 60  5
         return fromOutcome_;
 61  
     }
 62  
 
 63  
     public String getToViewId() {
 64  5
         return toViewId_;
 65  
     }
 66  
 
 67  
     public boolean isRedirect() {
 68  5
         return redirect_;
 69  
     }
 70  
 
 71  
     public boolean equals(Object obj) {
 72  0
         if (!(obj instanceof NavigationCaseElementImpl)) {
 73  0
             return false;
 74  
         }
 75  0
         NavigationCaseElementImpl navCase = (NavigationCaseElementImpl) obj;
 76  0
         String fromAction = navCase.getFromAction();
 77  0
         String fromOutcome = navCase.getFromOutcome();
 78  0
         String toViewId = navCase.getToViewId();
 79  0
         return (fromAction == null ? fromAction_ == null : fromAction
 80  
                 .equals(fromAction_))
 81  
                 && (fromOutcome == null ? fromOutcome_ == null : fromOutcome
 82  
                         .equals(fromOutcome_))
 83  
                 && (toViewId == null ? toViewId_ == null : toViewId
 84  
                         .equals(toViewId));
 85  
     }
 86  
 }