@Test public void testWalletAndCard() throws Exception { MoneySource moneySource = new MoneySource(true, true); assertEquals("money-source(\"wallet\",\"card\")", moneySource.value()); }
public String value() { if (!wallet && !card) { throw new IllegalArgumentException("money-source expected"); } String params; if (wallet && card) params = WALLET + "\",\"" + CARD; else { params = card ? CARD : WALLET; } return "money-source(\"" + params + "\")"; }
MoneySource implements Permission { public String value() { if (!wallet && !card) { throw new IllegalArgumentException("money-source expected"); } String params; if (wallet && card) params = WALLET + "\",\"" + CARD; else { params = card ? CARD : WALLET; } return "money-source(\"" + params + "\")"; } }
MoneySource implements Permission { public String value() { if (!wallet && !card) { throw new IllegalArgumentException("money-source expected"); } String params; if (wallet && card) params = WALLET + "\",\"" + CARD; else { params = card ? CARD : WALLET; } return "money-source(\"" + params + "\")"; } MoneySource(boolean wallet, boolean card); }
MoneySource implements Permission { public String value() { if (!wallet && !card) { throw new IllegalArgumentException("money-source expected"); } String params; if (wallet && card) params = WALLET + "\",\"" + CARD; else { params = card ? CARD : WALLET; } return "money-source(\"" + params + "\")"; } MoneySource(boolean wallet, boolean card); String value(); }
MoneySource implements Permission { public String value() { if (!wallet && !card) { throw new IllegalArgumentException("money-source expected"); } String params; if (wallet && card) params = WALLET + "\",\"" + CARD; else { params = card ? CARD : WALLET; } return "money-source(\"" + params + "\")"; } MoneySource(boolean wallet, boolean card); String value();  }