@Test public void testResultTypeIsValid() { receipt.setIssueDate(DateTime.valueOf("20111101000000", Format.SIMPLE)); actual = operator.dataCleansing(receipt); assertThat("対象データ(2011/11/01)ならVALID", actual, is(CleansingResultType.VALID)); receipt.setIssueDate(DateTime.valueOf("20111130000000", Format.SIMPLE)); actual = operator.dataCleansing(receipt); assertThat("対象データ(2011/11/30)ならVALID", actual, is(CleansingResultType.VALID)); }
@Branch public CleansingResultType dataCleansing(final Receipt receipt) { if (receipt.getReceiptIdOption().isNull() || receipt.getUnitSalesOption().isNull() || receipt.getUnitSales() < 0 || receipt.getSellingPriceOption().isNull() || receipt.getSellingPrice() < 0) { return CleansingResultType.INVALID; } if (receipt.getIssueDate().getElapsedSeconds() >= parameters .getFromIssueDate().getElapsedSeconds() && receipt.getIssueDate().getElapsedSeconds() <= parameters .getToIssueDate().getElapsedSeconds()) { return CleansingResultType.VALID; } else { return CleansingResultType.EXCLUDE; } }
CleansingOperator { @Branch public CleansingResultType dataCleansing(final Receipt receipt) { if (receipt.getReceiptIdOption().isNull() || receipt.getUnitSalesOption().isNull() || receipt.getUnitSales() < 0 || receipt.getSellingPriceOption().isNull() || receipt.getSellingPrice() < 0) { return CleansingResultType.INVALID; } if (receipt.getIssueDate().getElapsedSeconds() >= parameters .getFromIssueDate().getElapsedSeconds() && receipt.getIssueDate().getElapsedSeconds() <= parameters .getToIssueDate().getElapsedSeconds()) { return CleansingResultType.VALID; } else { return CleansingResultType.EXCLUDE; } } }
CleansingOperator { @Branch public CleansingResultType dataCleansing(final Receipt receipt) { if (receipt.getReceiptIdOption().isNull() || receipt.getUnitSalesOption().isNull() || receipt.getUnitSales() < 0 || receipt.getSellingPriceOption().isNull() || receipt.getSellingPrice() < 0) { return CleansingResultType.INVALID; } if (receipt.getIssueDate().getElapsedSeconds() >= parameters .getFromIssueDate().getElapsedSeconds() && receipt.getIssueDate().getElapsedSeconds() <= parameters .getToIssueDate().getElapsedSeconds()) { return CleansingResultType.VALID; } else { return CleansingResultType.EXCLUDE; } }  }
CleansingOperator { @Branch public CleansingResultType dataCleansing(final Receipt receipt) { if (receipt.getReceiptIdOption().isNull() || receipt.getUnitSalesOption().isNull() || receipt.getUnitSales() < 0 || receipt.getSellingPriceOption().isNull() || receipt.getSellingPrice() < 0) { return CleansingResultType.INVALID; } if (receipt.getIssueDate().getElapsedSeconds() >= parameters .getFromIssueDate().getElapsedSeconds() && receipt.getIssueDate().getElapsedSeconds() <= parameters .getToIssueDate().getElapsedSeconds()) { return CleansingResultType.VALID; } else { return CleansingResultType.EXCLUDE; } }  @Branch CleansingResultType dataCleansing(final Receipt receipt); @MasterCheck abstract boolean exists(@Key(group = "shopCode") Shop shop,
			@Key(group = "shopCode") Receipt receipt); @Update void setErrorMessage(ErrorReceipt error, String message); }
CleansingOperator { @Branch public CleansingResultType dataCleansing(final Receipt receipt) { if (receipt.getReceiptIdOption().isNull() || receipt.getUnitSalesOption().isNull() || receipt.getUnitSales() < 0 || receipt.getSellingPriceOption().isNull() || receipt.getSellingPrice() < 0) { return CleansingResultType.INVALID; } if (receipt.getIssueDate().getElapsedSeconds() >= parameters .getFromIssueDate().getElapsedSeconds() && receipt.getIssueDate().getElapsedSeconds() <= parameters .getToIssueDate().getElapsedSeconds()) { return CleansingResultType.VALID; } else { return CleansingResultType.EXCLUDE; } }  @Branch CleansingResultType dataCleansing(final Receipt receipt); @MasterCheck abstract boolean exists(@Key(group = "shopCode") Shop shop,
			@Key(group = "shopCode") Receipt receipt); @Update void setErrorMessage(ErrorReceipt error, String message);  }