@Test public void testConvertToBitcoinURI() throws Exception { Address goodAddress = new Address(MainNetParams.get(), MAINNET_GOOD_ADDRESS); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello&message=AMessage", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello", "AMessage")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello%20World&message=Mess%20%26%20age%20%2B%20hope", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello World", "Mess & age + hope")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?label=Hello&message=glory", BitcoinURI.convertToBitcoinURI(goodAddress, null, "Hello", "glory")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=0.1&message=glory", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("0.1"), null, "glory")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=0.1&message=glory", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("0.1"), "", "glory")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello", null)); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=12.34&label=Hello", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("12.34"), "Hello", "")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=1000", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("1000"), null, null)); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?amount=1000", BitcoinURI.convertToBitcoinURI(goodAddress, Utils.toNanoCoins("1000"), "", "")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?label=Hello", BitcoinURI.convertToBitcoinURI(goodAddress, null, "Hello", null)); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?message=Agatha", BitcoinURI.convertToBitcoinURI(goodAddress, null, null, "Agatha")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS + "?message=Agatha", BitcoinURI.convertToBitcoinURI(goodAddress, null, "", "Agatha")); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS, BitcoinURI.convertToBitcoinURI(goodAddress, null, null, null)); assertEquals(CoinDefinition.coinURIScheme + ":" + MAINNET_GOOD_ADDRESS, BitcoinURI.convertToBitcoinURI(goodAddress, null, "", "")); }
public static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message) { return convertToBitcoinURI(address.toString(), amount, label, message); }
BitcoinURI { public static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message) { return convertToBitcoinURI(address.toString(), amount, label, message); } }
BitcoinURI { public static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message) { return convertToBitcoinURI(address.toString(), amount, label, message); } BitcoinURI(String uri);  BitcoinURI(@Nullable NetworkParameters params, String input); }
BitcoinURI { public static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message) { return convertToBitcoinURI(address.toString(), amount, label, message); } BitcoinURI(String uri);  BitcoinURI(@Nullable NetworkParameters params, String input); @Nullable Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); String getPaymentRequestUrl(); Object getParameterByName(String name); @Override String toString(); static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message); static String convertToBitcoinURI(String address, @Nullable BigInteger amount, @Nullable String label,
                                             @Nullable String message); }
BitcoinURI { public static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message) { return convertToBitcoinURI(address.toString(), amount, label, message); } BitcoinURI(String uri);  BitcoinURI(@Nullable NetworkParameters params, String input); @Nullable Address getAddress(); BigInteger getAmount(); String getLabel(); String getMessage(); String getPaymentRequestUrl(); Object getParameterByName(String name); @Override String toString(); static String convertToBitcoinURI(Address address, BigInteger amount, String label, String message); static String convertToBitcoinURI(String address, @Nullable BigInteger amount, @Nullable String label,
                                             @Nullable String message); static final String FIELD_MESSAGE; static final String FIELD_LABEL; static final String FIELD_AMOUNT; static final String FIELD_ADDRESS; static final String FIELD_PAYMENT_REQUEST_URL; static final String BITCOIN_SCHEME; }