@Test public void testColumns() throws Exception { TypeLayer tl = new TypeLayer(new StringEncoder()); MockTransactionBase tt = new MockTransactionBase("r1,cf1:cq1,v1", "r1,cf1:cq2,v2", "r1,cf1:cq3,9", "r2,cf2:7,12", "r2,cf2:8,13", "13,9:17,20", "13,9:18,20", "13,9:19,20", "13,9:20,20"); TypedTransactionBase ttx = tl.wrap(tt); Map<Column, Value> results = ttx.get().row("r2") .columns(ImmutableSet.of(new Column("cf2", "6"), new Column("cf2", "7"))); Assert.assertNull(results.get(new Column("cf2", "6")).toInteger()); Assert.assertEquals(0, results.get(new Column("cf2", "6")).toInteger(0)); Assert.assertEquals(12, (int) results.get(new Column("cf2", "7")).toInteger()); Assert.assertEquals(12, results.get(new Column("cf2", "7")).toInteger(0)); Assert.assertEquals(1, results.size()); results = ttx.get().row("r2").columns( ImmutableSet.of(new Column("cf2", "6"), new Column("cf2", "7"), new Column("cf2", "8"))); Assert.assertNull(results.get(new Column("cf2", "6")).toInteger()); Assert.assertEquals(0, results.get(new Column("cf2", "6")).toInteger(0)); Assert.assertEquals(12, (int) results.get(new Column("cf2", "7")).toInteger()); Assert.assertEquals(12, results.get(new Column("cf2", "7")).toInteger(0)); Assert.assertEquals(13, (int) results.get(new Column("cf2", "8")).toInteger()); Assert.assertEquals(13, results.get(new Column("cf2", "8")).toInteger(0)); Assert.assertEquals(2, results.size()); Map<Column, Value> results2 = ttx.get().row("r2").columns(new Column("cf2", "6"), new Column("cf2", "7"), new Column("cf2", "8")); Assert.assertEquals(results, results2); }
public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } TypeLayer(Encoder encoder); }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } TypeLayer(Encoder encoder); CFB bc(); TypedSnapshot wrap(Snapshot snap); TypedTransactionBase wrap(TransactionBase tx); TypedTransaction wrap(Transaction tx); }
TypeLayer { public TypedSnapshot wrap(Snapshot snap) { return new TypedSnapshot(snap, encoder, this); } TypeLayer(Encoder encoder); CFB bc(); TypedSnapshot wrap(Snapshot snap); TypedTransactionBase wrap(TransactionBase tx); TypedTransaction wrap(Transaction tx);  }