@SuppressWarnings({ "checkstyle:IllegalThrows", "checkstyle:avoidHidingCauseException" }) @Test(expected = ReadFailedException.class) public void existsTestWithException() throws Throwable { doThrow(new NullPointerException("no Node")).when(DATA_TREE_SNAPSHOT).readNode(any()); try { snapshotBackedReadTransaction.exists(YangInstanceIdentifier.empty()).get(); fail("Expected ReadFailedException"); } catch (Exception e) { throw e.getCause(); } }
@Override public FluentFuture<Boolean> exists(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Exists: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); return read(path).transform(Optional::isPresent, MoreExecutors.directExecutor()); }
SnapshotBackedReadTransaction extends
        AbstractDOMStoreTransaction<T> implements DOMStoreReadTransaction, SnapshotBackedTransaction { @Override public FluentFuture<Boolean> exists(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Exists: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); return read(path).transform(Optional::isPresent, MoreExecutors.directExecutor()); } }
SnapshotBackedReadTransaction extends
        AbstractDOMStoreTransaction<T> implements DOMStoreReadTransaction, SnapshotBackedTransaction { @Override public FluentFuture<Boolean> exists(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Exists: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); return read(path).transform(Optional::isPresent, MoreExecutors.directExecutor()); } SnapshotBackedReadTransaction(final T identifier, final boolean debug, final DataTreeSnapshot snapshot,
            final TransactionClosePrototype<T> closeImpl); }
SnapshotBackedReadTransaction extends
        AbstractDOMStoreTransaction<T> implements DOMStoreReadTransaction, SnapshotBackedTransaction { @Override public FluentFuture<Boolean> exists(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Exists: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); return read(path).transform(Optional::isPresent, MoreExecutors.directExecutor()); } SnapshotBackedReadTransaction(final T identifier, final boolean debug, final DataTreeSnapshot snapshot,
            final TransactionClosePrototype<T> closeImpl); @Override void close(); @SuppressWarnings("checkstyle:IllegalCatch") @Override FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path); @Override FluentFuture<Boolean> exists(final YangInstanceIdentifier path); @Override Optional<DataTreeSnapshot> getSnapshot(); }
SnapshotBackedReadTransaction extends
        AbstractDOMStoreTransaction<T> implements DOMStoreReadTransaction, SnapshotBackedTransaction { @Override public FluentFuture<Boolean> exists(final YangInstanceIdentifier path) { LOG.debug("Tx: {} Exists: {}", getIdentifier(), path); requireNonNull(path, "Path must not be null."); return read(path).transform(Optional::isPresent, MoreExecutors.directExecutor()); } SnapshotBackedReadTransaction(final T identifier, final boolean debug, final DataTreeSnapshot snapshot,
            final TransactionClosePrototype<T> closeImpl); @Override void close(); @SuppressWarnings("checkstyle:IllegalCatch") @Override FluentFuture<Optional<NormalizedNode<?,?>>> read(final YangInstanceIdentifier path); @Override FluentFuture<Boolean> exists(final YangInstanceIdentifier path); @Override Optional<DataTreeSnapshot> getSnapshot();  }