001/* $Id: Address.java 1102402 2011-05-12 18:03:26Z simonetripodi $
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements.  See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License.  You may obtain a copy of the License at
009 *
010 *      http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019package org.apache.commons.digester3;
020
021/**
022 * Bean for Digester testing.
023 */
024
025public class Address
026{
027
028    public Address()
029    {
030        this( "My Street", "My City", "US", "MyZip" );
031    }
032
033    public Address( String street, String city, String state, String zipCode )
034    {
035        super();
036        setStreet( street );
037        setCity( city );
038        setState( state );
039        setZipCode( zipCode );
040    }
041
042    private String city = null;
043
044    public String getCity()
045    {
046        return ( this.city );
047    }
048
049    public void setCity( String city )
050    {
051        this.city = city;
052    }
053
054    private String state = null;
055
056    public String getState()
057    {
058        return ( this.state );
059    }
060
061    public void setState( String state )
062    {
063        this.state = state;
064    }
065
066    private String street = null;
067
068    public String getStreet()
069    {
070        return ( this.street );
071    }
072
073    public void setStreet( String street )
074    {
075        this.street = street;
076    }
077
078    private String type = null;
079
080    public String getType()
081    {
082        return ( this.type );
083    }
084
085    public void setType( String type )
086    {
087        this.type = type;
088    }
089
090    private String zipCode = null;
091
092    public String getZipCode()
093    {
094        return ( this.zipCode );
095    }
096
097    public void setZipCode( String zipCode )
098    {
099        this.zipCode = zipCode;
100    }
101
102    public void setEmployee( Employee employee )
103    {
104        employee.addAddress( this );
105    }
106
107    @Override
108    public String toString()
109    {
110        StringBuilder sb = new StringBuilder( "Address[" );
111        sb.append( "street=" );
112        sb.append( street );
113        sb.append( ", city=" );
114        sb.append( city );
115        sb.append( ", state=" );
116        sb.append( state );
117        sb.append( ", zipCode=" );
118        sb.append( zipCode );
119        sb.append( "]" );
120        return ( sb.toString() );
121    }
122
123}