* <p>
* @return Receipt number
*/
- Long getReceiptNumber ();
+ String getReceiptNumber ();
/**
* Setter for receipt number
* <p>
* @param receiptNumber Receipt number
*/
- void setReceiptNumber (final Long receiptNumber);
+ void setReceiptNumber (final String receiptNumber);
/**
* Getter for receipt register's number (cash register's number)
* Receipt number
*/
@Column (name = "receipt_number")
- private Long receiptNumber;
+ private String receiptNumber;
/**
* Payment type (cash, credit card, EC card ...)
}
@Override
- public Long getReceiptNumber () {
+ public String getReceiptNumber () {
return this.receiptNumber;
}
@Override
- public void setReceiptNumber (final Long receiptNumber) {
+ public void setReceiptNumber (final String receiptNumber) {
this.receiptNumber = receiptNumber;
}
} else if (receipt1.getReceiptBranchOffice().getBranchId() < 1) {
// Throw NPE
throw new NullPointerException(MessageFormat.format("receipt1.receiptBranchOffice.branchId={0} is not valid", receipt1.getReceiptBranchOffice().getBranchId()));
- } else if ((receipt1.getReceiptNumber() instanceof Long) && (receipt1.getReceiptNumber() < 1)) {
+ } else if ((receipt1.getReceiptNumber() != null) && (receipt1.getReceiptNumber().isEmpty())) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("receipt1.receiptNumber={0} is not valid.", receipt1.getReceiptNumber()));
+ throw new IllegalArgumentException("receipt1.receiptNumber is empty.");
} else if (receipt1.getReceiptPaymentType()== null) {
// Throw NPE
throw new NullPointerException("receipt1.receiptPaymentType is null");
} else if (receipt2.getReceiptBranchOffice().getBranchId() < 1) {
// Throw NPE
throw new NullPointerException(MessageFormat.format("receipt2.receiptBranchOffice.branchId={0} is not valid", receipt2.getReceiptBranchOffice().getBranchId()));
- } else if ((receipt2.getReceiptNumber() instanceof Long) && (receipt2.getReceiptNumber() < 1)) {
+ } else if ((receipt2.getReceiptNumber() != null) && (receipt2.getReceiptNumber().isEmpty())) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("receipt2.receiptNumber={0} is not valid.", receipt2.getReceiptNumber()));
+ throw new IllegalArgumentException("receipt2.receiptNumber is empty.");
} else if (receipt2.getReceiptPaymentType()== null) {
// Throw NPE
throw new NullPointerException("receipt2.receiptPaymentType is null");