@Test public void testAdaptedWriteTransactionPutsSuccessfully() throws Exception { TopLevelList data = newTestDataObject(); managedNewTransactionRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, writeTx -> TransactionAdapter.toWriteTransaction(writeTx).put(LogicalDatastoreType.OPERATIONAL, TEST_PATH, data)).get(); assertEquals(data, syncRead(LogicalDatastoreType.OPERATIONAL, TEST_PATH)); }
public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); static ReadWriteTransaction toReadWriteTransaction(
            final TypedReadWriteTransaction<? extends Datastore> datastoreTx); static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx); }
TransactionAdapter { public static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedWriteTransactionImpl) { final TypedWriteTransactionImpl<?, ?> txImpl = (TypedWriteTransactionImpl<?, ?>) datastoreTx; return new WriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); static ReadWriteTransaction toReadWriteTransaction(
            final TypedReadWriteTransaction<? extends Datastore> datastoreTx); static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx);  }