FormulaValue.java :  » ERP-CRM-Financial » OpenXava-3.0 » org » openxava » test » model » Java Open Source

Java Open Source » ERP CRM Financial » OpenXava 3.0 
OpenXava 3.0 » org » openxava » test » model » FormulaValue.java
/*
 * Generated by XDoclet - Do not edit!
 */
package org.openxava.test.model;

/**
 * Value object for Formula.
 *
 */
public class FormulaValue
   extends java.lang.Object
   implements java.io.Serializable 
{

   private static final long serialVersionUID = 1L;

   private java.lang.String recipe;
   private boolean recipeHasBeenSet = false;
   private java.lang.String oid;
   private boolean oidHasBeenSet = false;
   private java.lang.String name;
   private boolean nameHasBeenSet = false;

   public FormulaValue()
   {
   }

   //TODO Cloneable is better than this !
   public FormulaValue( FormulaValue otherValue )
   {
    this.recipe = otherValue.recipe;
    recipeHasBeenSet = true;
    this.oid = otherValue.oid;
    oidHasBeenSet = true;
    this.name = otherValue.name;
    nameHasBeenSet = true;
   }

   public java.lang.String getRecipe()
   {
    return this.recipe;
   }

   public void setRecipe( java.lang.String recipe )
   {
    this.recipe = recipe;
    recipeHasBeenSet = true;
   }

   public boolean recipeHasBeenSet(){
    return recipeHasBeenSet;
   }
   public java.lang.String getOid()
   {
    return this.oid;
   }

   public void setOid( java.lang.String oid )
   {
    this.oid = oid;
    oidHasBeenSet = true;
   }

   public boolean oidHasBeenSet(){
    return oidHasBeenSet;
   }
   public java.lang.String getName()
   {
    return this.name;
   }

   public void setName( java.lang.String name )
   {
    this.name = name;
    nameHasBeenSet = true;
   }

   public boolean nameHasBeenSet(){
    return nameHasBeenSet;
   }

   public String toString()
   {
    StringBuffer str = new StringBuffer("{");

    str.append("recipe=" + getRecipe() + " " + "oid=" + getOid() + " " + "name=" + getName());
    str.append('}');

    return(str.toString());
   }

   /**
    * A Value Object has an identity if the attributes making its Primary Key have all been set. An object without identity is never equal to any other object.
    *
    * @return true if this instance has an identity.
    */
   protected boolean hasIdentity()
   {
    boolean ret = true;
    ret = ret && oidHasBeenSet;
    return ret;
   }

   public boolean equals(Object other)
   {
      if (this == other)
         return true;
    if ( ! hasIdentity() ) return false;
    if (other instanceof FormulaValue)
    {
     FormulaValue that = (FormulaValue) other;
     if ( ! that.hasIdentity() ) return false;
     boolean lEquals = true;
     if( this.oid == null )
     {
      lEquals = lEquals && ( that.oid == null );
     }
     else
     {
      lEquals = lEquals && this.oid.equals( that.oid );
     }

     lEquals = lEquals && isIdentical(that);

     return lEquals;
    }
    else
    {
     return false;
    }
   }

   public boolean isIdentical(Object other)
   {
    if (other instanceof FormulaValue)
    {
     FormulaValue that = (FormulaValue) other;
     boolean lEquals = true;
     if( this.recipe == null )
     {
      lEquals = lEquals && ( that.recipe == null );
     }
     else
     {
      lEquals = lEquals && this.recipe.equals( that.recipe );
     }
     if( this.name == null )
     {
      lEquals = lEquals && ( that.name == null );
     }
     else
     {
      lEquals = lEquals && this.name.equals( that.name );
     }

     return lEquals;
    }
    else
    {
     return false;
    }
   }

   public int hashCode(){
    int result = 17;
      result = 37*result + ((this.recipe != null) ? this.recipe.hashCode() : 0);

      result = 37*result + ((this.oid != null) ? this.oid.hashCode() : 0);

      result = 37*result + ((this.name != null) ? this.name.hashCode() : 0);

    return result;
   }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.