Save This Page
Home » openjdk-7 » net.sf.raptor » ui » testdata » [javadoc | source]
    1   /*********************************************************************************
    2    *                                                                               *
    3    * Raptor - Rapid prototyping of Swing GUIs based on JavaBeans like Java objects *
    4    * Copyright (C) 2003  XCOM AG                                                   *
    5    *                                                                               *
    6    * This library is free software; you can redistribute it and/or                 *
    7    * modify it under the terms of the GNU Lesser General Public                    *
    8    * License as published by the Free Software Foundation; either                  *
    9    * version 2.1 of the License, or (at your option) any later version.            *
   10    *                                                                               *
   11    * This library is distributed in the hope that it will be useful,               *
   12    * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
   13    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
   14    * Lesser General Public License for more details.                               *
   15    *                                                                               *
   16    * You should have received a copy of the GNU Lesser General Public              *
   17    * License along with this library; if not, write to the Free Software           *
   18    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA     *
   19    *                                                                               *
   20    *********************************************************************************/
   21   package net.sf.raptor.ui.testdata;
   22   
   23   import java.io.Serializable;
   24   import org.apache.commons.lang.builder.EqualsBuilder;
   25   import org.apache.commons.lang.builder.HashCodeBuilder;
   26   import org.apache.commons.lang.builder.ToStringBuilder;
   27   
   28   /**
   29    * @author Hibernate/XCOM CodeGenerator
   30    *
   31    * DO NOT EDIT THIS CLASS MANUALLY!
   32    * use the subclass generation mechanism to
   33    * create subclassed files and modify the
   34    * generated subclasses instead
   35    */
   36   public class Address implements Serializable {
   37   
   38       /** identifier field */
   39       private Long id;
   40   
   41       /** persistent field */
   42       private Long version;
   43   
   44       /** persistent field */
   45       private java.util.Date validfrom;
   46   
   47       /** nullable persistent field */
   48       private String street;
   49   
   50       /** nullable persistent field */
   51       private String streettown;
   52   
   53       /** nullable persistent field */
   54       private String poboxtown;
   55   
   56       /** nullable persistent field */
   57       private String email;
   58   
   59       /** nullable persistent field */
   60       private Long state;
   61   
   62       /** nullable persistent field */
   63       private Long country;
   64   
   65       /** nullable persistent field */
   66       private String streetpostalcode;
   67   
   68       /** nullable persistent field */
   69       private String poboxpostalcode;
   70   
   71       /** nullable persistent field */
   72       private String pobox;
   73   
   74       /** nullable persistent field */
   75       private String phone;
   76   
   77       /** nullable persistent field */
   78       private String fax;
   79   
   80       /** nullable persistent field */
   81       private String mobilephone;
   82   
   83       /** full constructor */
   84       public Address(java.lang.Long version, java.util.Date validfrom, java.lang.String street, java.lang.String streettown, java.lang.String poboxtown, java.lang.String email, java.lang.Long state, java.lang.Long country, java.lang.String streetpostalcode, java.lang.String poboxpostalcode, java.lang.String pobox, java.lang.String phone, java.lang.String fax, java.lang.String mobilephone) {
   85           this.version = version;
   86           this.validfrom = validfrom;
   87           this.street = street;
   88           this.streettown = streettown;
   89           this.poboxtown = poboxtown;
   90           this.email = email;
   91           this.state = state;
   92           this.country = country;
   93           this.streetpostalcode = streetpostalcode;
   94           this.poboxpostalcode = poboxpostalcode;
   95           this.pobox = pobox;
   96           this.phone = phone;
   97           this.fax = fax;
   98           this.mobilephone = mobilephone;
   99       }
  100   
  101       /** default constructor */
  102       public Address() {
  103       }
  104   
  105       /** minimal constructor */
  106       public Address(java.lang.Long version, java.util.Date validfrom) {
  107           this.version = version;
  108           this.validfrom = validfrom;
  109       }
  110   
  111       public java.lang.Long getId() {
  112           return this.id;
  113       }
  114   
  115       public void setId(java.lang.Long id) {
  116           this.id = id;
  117       }
  118       public java.lang.Long getVersion() {
  119           return this.version;
  120       }
  121   
  122       public void setVersion(java.lang.Long version) {
  123           this.version = version;
  124       }
  125       public java.util.Date getValidfrom() {
  126           return this.validfrom;
  127       }
  128   
  129       public void setValidfrom(java.util.Date validfrom) {
  130           this.validfrom = validfrom;
  131       }
  132       public java.lang.String getStreet() {
  133           return this.street;
  134       }
  135   
  136       public void setStreet(java.lang.String street) {
  137           this.street = street;
  138       }
  139       public java.lang.String getStreettown() {
  140           return this.streettown;
  141       }
  142   
  143       public void setStreettown(java.lang.String streettown) {
  144           this.streettown = streettown;
  145       }
  146       public java.lang.String getPoboxtown() {
  147           return this.poboxtown;
  148       }
  149   
  150       public void setPoboxtown(java.lang.String poboxtown) {
  151           this.poboxtown = poboxtown;
  152       }
  153       public java.lang.String getEmail() {
  154           return this.email;
  155       }
  156   
  157       public void setEmail(java.lang.String email) {
  158           this.email = email;
  159       }
  160       public java.lang.Long getState() {
  161           return this.state;
  162       }
  163   
  164       public void setState(java.lang.Long state) {
  165           this.state = state;
  166       }
  167       public java.lang.Long getCountry() {
  168           return this.country;
  169       }
  170   
  171       public void setCountry(java.lang.Long country) {
  172           this.country = country;
  173       }
  174       public java.lang.String getStreetpostalcode() {
  175           return this.streetpostalcode;
  176       }
  177   
  178       public void setStreetpostalcode(java.lang.String streetpostalcode) {
  179           this.streetpostalcode = streetpostalcode;
  180       }
  181       public java.lang.String getPoboxpostalcode() {
  182           return this.poboxpostalcode;
  183       }
  184   
  185       public void setPoboxpostalcode(java.lang.String poboxpostalcode) {
  186           this.poboxpostalcode = poboxpostalcode;
  187       }
  188       public java.lang.String getPobox() {
  189           return this.pobox;
  190       }
  191   
  192       public void setPobox(java.lang.String pobox) {
  193           this.pobox = pobox;
  194       }
  195       public java.lang.String getPhone() {
  196           return this.phone;
  197       }
  198   
  199       public void setPhone(java.lang.String phone) {
  200           this.phone = phone;
  201       }
  202       public java.lang.String getFax() {
  203           return this.fax;
  204       }
  205   
  206       public void setFax(java.lang.String fax) {
  207           this.fax = fax;
  208       }
  209       public java.lang.String getMobilephone() {
  210           return this.mobilephone;
  211       }
  212   
  213       public void setMobilephone(java.lang.String mobilephone) {
  214           this.mobilephone = mobilephone;
  215       }
  216   
  217       public String toString() {
  218           return ToStringBuilder.reflectionToString(this);
  219       }
  220   
  221       public boolean equals(Object other) {
  222           if ( !(other instanceof Address) ) return false;
  223           Address castOther = (Address) other;
  224           return new EqualsBuilder()
  225               .append(this.id, castOther.id)
  226               .isEquals();
  227       }
  228   
  229       public int hashCode() {
  230           return new HashCodeBuilder()
  231               .append(id)
  232               .toHashCode();
  233       }
  234   
  235       /***********************************/
  236       /* now comes the weak binding part */
  237       /***********************************/
  238   
  239       /** the numer of fields in this class */
  240       private int fieldCount = 15;
  241   
  242       /** 
  243        * getFieldCount 
  244        *
  245        * @return the number of fields in this class
  246        */
  247       public int getFieldCount() { return fieldCount; }
  248   
  249       /** 
  250        * getFieldNameAt 
  251        *
  252        * @return field name in this class
  253        */
  254       public String getFieldNameAt(int index) {
  255   
  256           switch(index) {
  257   
  258               case 0: return "id";
  259               case 1: return "version";
  260               case 2: return "validfrom";
  261               case 3: return "street";
  262               case 4: return "streettown";
  263               case 5: return "poboxtown";
  264               case 6: return "email";
  265               case 7: return "state";
  266               case 8: return "country";
  267               case 9: return "streetpostalcode";
  268               case 10: return "poboxpostalcode";
  269               case 11: return "pobox";
  270               case 12: return "phone";
  271               case 13: return "fax";
  272               case 14: return "mobilephone";
  273               default: throw new IllegalArgumentException("requestes index bigger than field count");
  274   
  275           }
  276   
  277       }
  278   
  279       /** 
  280        * getFieldValueAt 
  281        *
  282        * @return field value in this class
  283        */
  284       public Object getFieldValueAt(int index) {
  285   
  286           switch(index) {
  287               case 0: return id;
  288               case 1: return version;
  289               case 2: return validfrom;
  290               case 3: return street;
  291               case 4: return streettown;
  292               case 5: return poboxtown;
  293               case 6: return email;
  294               case 7: return state;
  295               case 8: return country;
  296               case 9: return streetpostalcode;
  297               case 10: return poboxpostalcode;
  298               case 11: return pobox;
  299               case 12: return phone;
  300               case 13: return fax;
  301               case 14: return mobilephone;
  302           }
  303   
  304           throw new IllegalArgumentException("requested index bigger than field count");
  305   
  306       }
  307   
  308       /** 
  309        * setFieldValueAt 
  310        *
  311        * @param index the index of the field whose value should be set
  312        * @param value the value to be set
  313        */
  314       public void setFieldValueAt(int index, Object value) {
  315   
  316           switch(index) {
  317               case 0: id = (Long) value; return;
  318               case 1: version = (Long) value; return;
  319               case 2: validfrom = (java.util.Date) value; return;
  320               case 3: street = (String) value; return;
  321               case 4: streettown = (String) value; return;
  322               case 5: poboxtown = (String) value; return;
  323               case 6: email = (String) value; return;
  324               case 7: state = (Long) value; return;
  325               case 8: country = (Long) value; return;
  326               case 9: streetpostalcode = (String) value; return;
  327               case 10: poboxpostalcode = (String) value; return;
  328               case 11: pobox = (String) value; return;
  329               case 12: phone = (String) value; return;
  330               case 13: fax = (String) value; return;
  331               case 14: mobilephone = (String) value; return;
  332           }
  333   
  334           throw new IllegalArgumentException("requested index bigger than field count");
  335   
  336       }
  337   
  338       /** 
  339        * getFieldValueByName 
  340        *
  341        * @return field value in this class
  342        */
  343       public Object getFieldValueByName(String name) {
  344   
  345           if( name.equals("id") ) return id;
  346           if( name.equals("version") ) return version;
  347           if( name.equals("validfrom") ) return validfrom;
  348           if( name.equals("street") ) return street;
  349           if( name.equals("streettown") ) return streettown;
  350           if( name.equals("poboxtown") ) return poboxtown;
  351           if( name.equals("email") ) return email;
  352           if( name.equals("state") ) return state;
  353           if( name.equals("country") ) return country;
  354           if( name.equals("streetpostalcode") ) return streetpostalcode;
  355           if( name.equals("poboxpostalcode") ) return poboxpostalcode;
  356           if( name.equals("pobox") ) return pobox;
  357           if( name.equals("phone") ) return phone;
  358           if( name.equals("fax") ) return fax;
  359           if( name.equals("mobilephone") ) return mobilephone;
  360   
  361           throw new IllegalArgumentException("unknown field name " + name );
  362   
  363       }
  364   
  365   }

Save This Page
Home » openjdk-7 » net.sf.raptor » ui » testdata » [javadoc | source]