CoinURI implements Serializable { public Value getAmount() { return (Value) parameterMap.get(FIELD_AMOUNT); } CoinURI(String uri);  CoinURI(@Nullable CoinType uriType, String input); CoinType getTypeRequired(); @Nullable CoinType getType(); boolean hasType(); @Nullable AbstractAddress getAddress(); Value getAmount(); String getLabel(); String getMessage(); String getPublicKey(); String getPaymentRequestUrl(); URI getAddressRequestUri(); boolean isAddressRequest(); URI getAddressRequestUriResponse(AbstractAddress address); URI getAddressRequestUriResponse(String address); Object getParameterByName(String name); @Override String toString(); static String convertToCoinURI(AbstractAddress address); static String convertToCoinURI(AbstractAddress address, @Nullable Value amount,
                                          @Nullable String label, @Nullable String message); static String convertToCoinURI(AbstractAddress address, @Nullable Value amount,
                                          @Nullable String label, @Nullable String message,
                                          @Nullable String pubkey); String toUriString(); 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 FIELD_ADDRESS_REQUEST_URI; static final String FIELD_NETWORK; static final String FIELD_PUBKEY; }
@Test public void testGood_Amount() throws CoinURIParseException { testObject = new CoinURI(BitcoinMain.get(), BitcoinMain.get().getUriScheme() + ":" + MAINNET_GOOD_ADDRESS + "?amount=6543210.12345678"); assertEquals(654321012345678L, testObject.getAmount().value); testObject = new CoinURI(BitcoinMain.get(), BitcoinMain.get().getUriScheme() + ":" + MAINNET_GOOD_ADDRESS + "?amount=.12345678"); assertEquals(12345678L, testObject.getAmount().value); testObject = new CoinURI(BitcoinMain.get(), BitcoinMain.get().getUriScheme() + ":" + MAINNET_GOOD_ADDRESS + "?amount=6543210"); assertEquals(654321000000000L, testObject.getAmount().value); }