/*
 * Generated file - Do not edit!
 */
package com.alodar.example.interfaces;

import java.lang.*;

/**
 * Primary key for Item.
 * @author XDOCLET 1.1.2
 * @xdoclet-generated at Aug 25, 2002 3:02:28 PM
 */
public class ItemPK
   extends java.lang.Object
   implements java.io.Serializable
{
   static final long serialVersionUID = -9168028755305208442L;
   transient private int _hashCode = Integer.MIN_VALUE;
   transient private String value = null;

   public java.lang.Integer itemId;

   public ItemPK()
   {
   }

   public ItemPK( java.lang.Integer itemId )
   {
      this.itemId = itemId;
   }

   public java.lang.Integer getItemId()
   {
      return itemId;
   }

   public void setItemId(java.lang.Integer itemId)
   {
      this.itemId = itemId;
   }

   public int hashCode()
   {
      if( _hashCode == Integer.MIN_VALUE )
      {
         _hashCode += this.itemId.hashCode();
      }

      return _hashCode;
   }

   public boolean equals(Object obj)
   {
      if( !(obj instanceof com.alodar.example.interfaces.ItemPK) )
         return false;

      com.alodar.example.interfaces.ItemPK pk = (com.alodar.example.interfaces.ItemPK)obj;
      boolean eq = true;

      if( obj == null )
      {
         eq = false;
      }
      else
      {
         if( this.itemId == null && ((com.alodar.example.interfaces.ItemPK)obj).getItemId() == null )
         {
            eq = true;
         }
         else
         {
            if( this.itemId == null || ((com.alodar.example.interfaces.ItemPK)obj).getItemId() == null )
            {
               eq = false;
            }
            else
            {
               eq = eq && this.itemId.equals( pk.itemId );
            }
         }
      }

      return eq;
   }

   public String toString()
   {
      if( value == null )
      {
         value = "[.";
         value += this.itemId+".";
         value += "]";
      }

      return value;
   }
}