@Override public ResolvedBillTrade resolve(ReferenceData refData) { ResolvedBill resolved = product.resolve(refData); return new ResolvedBillTrade(info, resolved, getQuantity(), null); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 3237038: // info return ((BillPosition) bean).getInfo(); case -309474065: // product return ((BillPosition) bean).getProduct(); case 611668775: // longQuantity return ((BillPosition) bean).getLongQuantity(); case -2094395097: // shortQuantity return ((BillPosition) bean).getShortQuantity(); case -1285004149: // quantity return ((BillPosition) bean).getQuantity(); } return super.propertyGet(bean, propertyName, quiet); }
@Override public PortfolioItemSummary summarize() { // ID x 200 String description = getSecurityId().getStandardId().getValue() + " x " + SummarizerUtils.value(getQuantity()); return SummarizerUtils.summary(this, ProductType.BILL, description, getCurrency()); }
public void test_builder_of() { BillPosition test = BillPosition.builder() .info(POSITION_INFO1) .product(PRODUCT1) .longQuantity(QUANTITY1) .shortQuantity(QUANTITY2) .build(); assertEquals(test.getCurrency(), USD); assertEquals(test.getId(), POSITION_INFO1.getId()); assertEquals(test.getInfo(), POSITION_INFO1); assertEquals(test.getLongQuantity(), QUANTITY1); assertEquals(test.getShortQuantity(), QUANTITY2); assertEquals(test.getProduct(), PRODUCT1); assertEquals(test.getQuantity(), QUANTITY1 - QUANTITY2); assertEquals(test.getSecurityId(), PRODUCT1.getSecurityId()); BillPosition test1 = BillPosition.ofLongShort(POSITION_INFO1, PRODUCT1, QUANTITY1, QUANTITY2); assertEquals(test, test1); }