ItemRequest.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.model;
  16. /**
  17. *
  18. */
  19. public class ItemRequest
  20. {
  21. int _objectId;
  22. int _itemId;
  23. long _count;
  24. long _price;
  25. public ItemRequest(int objectId, long count, long price)
  26. {
  27. _objectId = objectId;
  28. _count = count;
  29. _price = price;
  30. }
  31. public ItemRequest(int objectId, int itemId, long count, long price)
  32. {
  33. _objectId = objectId;
  34. _itemId = itemId;
  35. _count = count;
  36. _price = price;
  37. }
  38. public int getObjectId(){return _objectId;}
  39. public int getItemId(){return _itemId;}
  40. public void setCount(long count){_count = count;}
  41. public long getCount(){return _count;}
  42. public long getPrice(){return _price;}
  43. /* (non-Javadoc)
  44. * @see java.lang.Object#hashCode()
  45. */
  46. @Override
  47. public int hashCode()
  48. {
  49. return _objectId;
  50. }
  51. /* (non-Javadoc)
  52. * @see java.lang.Object#equals(java.lang.Object)
  53. */
  54. @Override
  55. public boolean equals(Object obj)
  56. {
  57. if (this == obj)
  58. {
  59. return true;
  60. }
  61. if (obj == null)
  62. {
  63. return false;
  64. }
  65. if (getClass() != obj.getClass())
  66. {
  67. return false;
  68. }
  69. ItemRequest other = (ItemRequest) obj;
  70. if (_objectId != other._objectId)
  71. {
  72. return false;
  73. }
  74. return true;
  75. }
  76. }