public class ImmutableItem extends ImmutableBaseData implements Item
Item in ImmutableBaseData hierarchy.| Constructor and Description |
|---|
ImmutableItem(int id,
String title,
long price,
int quantity,
ImmutablePerson paidBy,
ImmutableGroup groupToPay,
ImmutablePerson personToPay)
Create immutable item.
|
| Modifier and Type | Method and Description |
|---|---|
ImmutablePerson |
getGetPaidByPerson()
Get the "paid by" person object.
|
Integer |
getGroupToPay()
Get the ID of the
Person who should pay for the item alone
(optional). |
ImmutableGroup |
getGroupToPayGroup()
Get the "group to pay" group object.
|
Integer |
getPaidBy()
|
Integer |
getPersonToPay()
Get the ID of the
Person who should pay for the item alone
(optional). |
ImmutablePerson |
getPersonToPayPerson()
Get the "person to pay" person object.
|
long |
getPrice()
Get the price in the base unit (cents).
|
int |
getQuantity()
Get the quantity of the items (multiplicator for
Item.getPrice() to
calculate Item.getTotal()). |
String |
getTitle()
Get the title of the item
|
equals, getId, hashCodepublic ImmutableItem(int id,
String title,
long price,
int quantity,
ImmutablePerson paidBy,
ImmutableGroup groupToPay,
ImmutablePerson personToPay)
id - ID of itemtitle - title of itemprice - price of itemquantity - quanitity of itempaidBy - "paid by" person object (optional)groupToPay - "group to pay" group object (optional)personToPay - "person to pay" person object (optional)public long getPrice()
Itempublic int getQuantity()
ItemItem.getPrice() to
calculate Item.getTotal()). This number must be positive.getQuantity in interface Itempublic ImmutablePerson getGetPaidByPerson()
public Integer getGroupToPay()
ItemPerson who should pay for the item alone
(optional).getGroupToPay in interface ItemGroup or nullpublic ImmutableGroup getGroupToPayGroup()
public Integer getPersonToPay()
ItemPerson who should pay for the item alone
(optional).getPersonToPay in interface ItemPerson or nullpublic ImmutablePerson getPersonToPayPerson()
Copyright © 2015 illucIT Software GmbH. All rights reserved.