ItemRequest.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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()
  43. {
  44. return _price;
  45. }
  46. @Override
  47. public int hashCode()
  48. {
  49. return _objectId;
  50. }
  51. @Override
  52. public boolean equals(Object obj)
  53. {
  54. if (this == obj)
  55. {
  56. return true;
  57. }
  58. if (obj == null)
  59. {
  60. return false;
  61. }
  62. if (getClass() != obj.getClass())
  63. {
  64. return false;
  65. }
  66. ItemRequest other = (ItemRequest) obj;
  67. if (_objectId != other._objectId)
  68. {
  69. return false;
  70. }
  71. return true;
  72. }
  73. }