001    /*****************************************************************************
002     * Copyright (C) NanoContainer Organization. All rights reserved.            *
003     * ------------------------------------------------------------------------- *
004     * The software in this package is published under the terms of the BSD      *
005     * style license a copy of which has been included with this distribution in *
006     * the LICENSE.txt file.                                                     *
007     *                                                                           *
008     *****************************************************************************/
009    package org.nanocontainer.nanowar.sample.model;
010    
011    import java.io.Serializable;
012    
013    /**
014     * @author Stephen Molitor
015     * @author Mauro Talevi
016     */
017    public class Cheese implements Serializable {
018    
019        private String name;
020        private String country;
021    
022        public Cheese() {
023            // default constructor used by some frameworks
024        }
025    
026        public Cheese(String name, String country) {
027            this.name = name;
028            this.country = country;
029            if (name == null) {
030                throw new NullPointerException("name");
031            }
032            if (country == null) {
033                throw new NullPointerException("country");
034            }
035        }
036    
037        public String getName() {
038            return name;
039        }
040    
041        public void setName( String name ) {
042            this.name = name;
043        }
044        
045        public String getCountry() {
046            return country;
047        }
048        
049        public void setCountry( String country ) {
050            this.country = country;
051        }
052    
053        public String toString() {
054            return "[Cheese name=" + name + ", country=" + country + "]";
055        }
056    
057    }