2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

Coverage Report - org.apache.shale.usecases.rolodex.Address
 
Classes in this File Line Coverage Branch Coverage Complexity
Address
100%
23/23
N/A
1.062
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 3  
  * contributor license agreements.  See the NOTICE file distributed with
 4  
  * this work for additional information regarding copyright ownership.
 5  
  * The ASF licenses this file to you under the Apache License, Version 2.0
 6  
  * (the "License"); you may not use this file except in compliance with
 7  
  * the License.  You may obtain a copy of the License at
 8  
  *
 9  
  *      http://www.apache.org/licenses/LICENSE-2.0
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 
 18  
 package org.apache.shale.usecases.rolodex;
 19  
 
 20  
 /**
 21  
  * <p>Holds an addres for a {@link Contact}.</p>
 22  
  */
 23  60
 public class Address {
 24  60
     String street1 = null;
 25  
 
 26  60
     String street2 = null;
 27  
 
 28  60
     String city = null;
 29  
 
 30  60
     String state = null;
 31  
 
 32  60
     int zip = 0;
 33  
 
 34  60
     String province = null;
 35  
 
 36  60
     String country = null;
 37  
     
 38  
 
 39  
     /**
 40  
      * <p>
 41  
      * Returns the City.
 42  
      * </p>
 43  
      */
 44  
     public String getCity() {
 45  
         return city;
 46  
     }
 47  
 
 48  
     /**
 49  
      * <p>
 50  
      * Sets the City.
 51  
      * </p>
 52  
      */
 53  
     public void setCity(String city) {
 54  60
         this.city = city;
 55  60
     }
 56  
 
 57  
     /**
 58  
      * <p>
 59  
      * Gets the Country.
 60  
      * </p>
 61  
      */
 62  
     public String getCountry() {
 63  
         return country;
 64  
     }
 65  
 
 66  
     /**
 67  
      * <p>
 68  
      * Sets the Country.
 69  
      * </p>
 70  
      */
 71  
     public void setCountry(String country) {
 72  30
         this.country = country;
 73  30
     }
 74  
 
 75  
     /**
 76  
      * <p>
 77  
      * Gets the Province.
 78  
      * </p>
 79  
      */
 80  
     public String getProvince() {
 81  
         return province;
 82  
     }
 83  
 
 84  
     /**
 85  
      * <p>
 86  
      * Sets the Province.
 87  
      * </p>
 88  
      */
 89  
     public void setProvince(String province) {
 90  30
         this.province = province;
 91  30
     }
 92  
 
 93  
     /**
 94  
      * <p>
 95  
      * Gets the State.
 96  
      * </p>
 97  
      */
 98  
     public String getState() {
 99  
         return state;
 100  
     }
 101  
 
 102  
     /**
 103  
      * <p>
 104  
      * Sets the State.
 105  
      * </p>
 106  
      */
 107  
     public void setState(String state) {
 108  60
         this.state = state;
 109  60
     }
 110  
 
 111  
     /**
 112  
      * <p>
 113  
      * Gets the Street1.
 114  
      * </p>
 115  
      */
 116  
     public String getStreet1() {
 117  
         return street1;
 118  
     }
 119  
 
 120  
     /**
 121  
      * <p>
 122  
      * Sets the Street1.
 123  
      * </p>
 124  
      */
 125  
     public void setStreet1(String street1) {
 126  60
         this.street1 = street1;
 127  60
     }
 128  
 
 129  
     /**
 130  
      * <p>
 131  
      * Gets the Street2.
 132  
      * </p>
 133  
      */
 134  
     public String getStreet2() {
 135  
         return street2;
 136  
     }
 137  
 
 138  
     /**
 139  
      * <p>
 140  
      * Sets the Street2.
 141  
      * </p>
 142  
      */
 143  
     public void setStreet2(String street2) {
 144  60
         this.street2 = street2;
 145  60
     }
 146  
 
 147  
     /**
 148  
      * <p>
 149  
      * Gets the Zip Code.
 150  
      * </p>
 151  
      */
 152  
     public int getZip() {
 153  
         return zip;
 154  
     }
 155  
 
 156  
     /**
 157  
      * <p>
 158  
      * Sets the Zip Code.
 159  
      * </p>
 160  
      */
 161  
     public void setZip(int zip) {
 162  
         this.zip = zip;
 163  
     }
 164  
 
 165  
     
 166  
     /**
 167  
      * <p>
 168  
      * Gets the Zip Code.
 169  
      * </p>
 170  
      */
 171  
     public String getZipAsString() {
 172  
         return String.valueOf(zip);
 173  
     }
 174  
 
 175  
     /**
 176  
      * <p>
 177  
      * Sets the Zip Code.
 178  
      * </p>
 179  
      */
 180  
     public void setZipAsString(String zip) {
 181  
         try {
 182  60
             this.zip = Integer.parseInt(zip);
 183  55
         } catch (NumberFormatException e) {}
 184  60
     }
 185  
 
 186  
 }