@Test public void testBitEasyCom() { final String expectedId = "biteasy"; assertThat(expectedId.equals(BitEasyComBlockExplorer.ID)); Optional<BlockExplorer> blockExplorerOptional = BlockExplorers.getBlockExplorerById(BitEasyComBlockExplorer.ID); assertThat(blockExplorerOptional.isPresent()).isTrue(); BlockExplorer blockExplorer = blockExplorerOptional.get(); assertThat(blockExplorer instanceof BitEasyComBlockExplorer).isTrue(); assertThat(blockExplorer.getName().equals("biteasy.com")).isTrue(); MessageFormat format = blockExplorer.getTransactionLookupMessageFormat(); assertThat(EXPECTED_BIT_EASY_COM_URL.equals(format.format(EXAMPLE_TX_ID))).isTrue(); }
public static Optional<BlockExplorer> getBlockExplorerById(String id) { Preconditions.checkNotNull(id); for (BlockExplorer blockExplorer : allBlockExplorers) { if (blockExplorer.getId().equals(id)) { return Optional.of(blockExplorer); } } return Optional.absent(); }
BlockExplorers { public static Optional<BlockExplorer> getBlockExplorerById(String id) { Preconditions.checkNotNull(id); for (BlockExplorer blockExplorer : allBlockExplorers) { if (blockExplorer.getId().equals(id)) { return Optional.of(blockExplorer); } } return Optional.absent(); } }
BlockExplorers { public static Optional<BlockExplorer> getBlockExplorerById(String id) { Preconditions.checkNotNull(id); for (BlockExplorer blockExplorer : allBlockExplorers) { if (blockExplorer.getId().equals(id)) { return Optional.of(blockExplorer); } } return Optional.absent(); } private  BlockExplorers(); }
BlockExplorers { public static Optional<BlockExplorer> getBlockExplorerById(String id) { Preconditions.checkNotNull(id); for (BlockExplorer blockExplorer : allBlockExplorers) { if (blockExplorer.getId().equals(id)) { return Optional.of(blockExplorer); } } return Optional.absent(); } private  BlockExplorers(); static List<BlockExplorer> getAll(); static Optional<BlockExplorer> getBlockExplorerById(String id); static BlockExplorer getDefaultBlockExplorer(); }
BlockExplorers { public static Optional<BlockExplorer> getBlockExplorerById(String id) { Preconditions.checkNotNull(id); for (BlockExplorer blockExplorer : allBlockExplorers) { if (blockExplorer.getId().equals(id)) { return Optional.of(blockExplorer); } } return Optional.absent(); } private  BlockExplorers(); static List<BlockExplorer> getAll(); static Optional<BlockExplorer> getBlockExplorerById(String id); static BlockExplorer getDefaultBlockExplorer();  }