Span implements Serializable { public static Builder newBuilder() { return new Builder(); } Span(); private  Span(Builder builder);  Span(RowColumn start, boolean startInclusive, RowColumn end, boolean endInclusive);  Span(Bytes startRow, boolean startRowInclusive, Bytes endRow, boolean endRowInclusive);  Span(CharSequence startRow, boolean startRowInclusive, CharSequence endRow,
      boolean endRowInclusive); RowColumn getStart(); RowColumn getEnd(); boolean isStartInclusive(); boolean isEndInclusive(); @Override boolean equals(Object o); boolean equals(Span other); @Override String toString(); @Override int hashCode(); static Span exact(Bytes row); static Span exact(CharSequence row); static Span exact(Bytes row, Column col); static Span exact(CharSequence row, Column col); static Span prefix(Bytes rowPrefix); static Span prefix(CharSequence rowPrefix); static Span prefix(Bytes row, Column colPrefix); static Span prefix(CharSequence row, Column colPrefix); static Builder newBuilder();  }
@Test public void testRowRange() { Assert.assertEquals(new Span(rw1b, true, rw2b, false), Span.newBuilder().startRow(rw1b).endRow(rw2b).exclusive().build()); Assert.assertEquals(new Span(rw1b, false, rw2b, false), Span.newBuilder().startRow(rw1b).exclusive().endRow(rw2b).exclusive().build()); Assert.assertEquals(new Span(rw1b, true, rw2b, true), Span.newBuilder().startRow(rw1b).endRow(rw2b).build()); Assert.assertEquals(new Span(rw1b, false, rw2b, true), Span.newBuilder().startRow(rw1b).exclusive().endRow(rw2b).build()); Assert.assertEquals(new Span(rw1b, true, rw2b, false), Span.newBuilder().startRow(rw1s).endRow(rw2s).exclusive().build()); Assert.assertEquals(new Span(rw1b, false, rw2b, false), Span.newBuilder().startRow(rw1s).exclusive().endRow(rw2s).exclusive().build()); Assert.assertEquals(new Span(rw1b, true, rw2b, true), Span.newBuilder().startRow(rw1s).endRow(rw2s).build()); Assert.assertEquals(new Span(rw1b, false, rw2b, true), Span.newBuilder().startRow(rw1s).exclusive().endRow(rw2s).build()); }
@Test public void testInfiniteRanges() { RowColumn rc1 = new RowColumn(rw1b, new Column(cf1b)); RowColumn frc1 = rc1.following(); RowColumn rc2 = new RowColumn(rw2b, new Column(cf2b)); RowColumn frc2 = rc2.following(); Assert.assertEquals(new Span(RowColumn.EMPTY, true, frc2, false), Span.newBuilder().endRow(rw2b).fam(cf2b).build()); Assert.assertEquals(new Span(RowColumn.EMPTY, true, rc2, false), Span.newBuilder().endRow(rw2b).fam(cf2b).exclusive().build()); Assert.assertEquals(new Span(rc1, true, RowColumn.EMPTY, true), Span.newBuilder().startRow(rw1b).fam(cf1b).build()); Assert.assertEquals(new Span(frc1, true, RowColumn.EMPTY, true), Span.newBuilder().startRow(rw1b).fam(cf1b).exclusive().build()); }
@Test public void testRowCFRange() { RowColumn rc1 = new RowColumn(rw1b, new Column(cf1b)); RowColumn frc1 = rc1.following(); RowColumn rc2 = new RowColumn(rw2b, new Column(cf2b)); RowColumn frc2 = rc2.following(); Assert.assertEquals(new Span(rc1, true, frc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b).endRow(rw2b).fam(cf2b).build()); Assert.assertEquals(new Span(rc1, true, rc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b).endRow(rw2b).fam(cf2b).exclusive().build()); Assert.assertEquals(new Span(frc1, true, frc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b).exclusive().endRow(rw2b).fam(cf2b).build()); Assert.assertEquals(new Span(frc1, true, rc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b) .exclusive().endRow(rw2b).fam(cf2b).exclusive().build()); }
@Test public void testRowCFCQRange() { RowColumn rc1 = new RowColumn(rw1b, new Column(cf1b, cq1b)); RowColumn frc1 = rc1.following(); RowColumn rc2 = new RowColumn(rw2b, new Column(cf2b, cq2b)); RowColumn frc2 = rc2.following(); Assert.assertEquals(new Span(rc1, true, frc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b) .qual(cq1b).endRow(rw2b).fam(cf2b).qual(cq2b).build()); Assert.assertEquals(new Span(rc1, true, rc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b) .qual(cq1b).endRow(rw2b).fam(cf2b).qual(cq2b).exclusive().build()); Assert.assertEquals(new Span(frc1, true, frc2, false), Span.newBuilder().startRow(rw1b) .fam(cf1b).qual(cq1b).exclusive().endRow(rw2b).fam(cf2b).qual(cq2b).build()); Assert.assertEquals(new Span(frc1, true, rc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b) .qual(cq1b).exclusive().endRow(rw2b).fam(cf2b).qual(cq2b).exclusive().build()); }
@Test public void testRowCFCQCVRange() { RowColumn rc1 = new RowColumn(rw1b, new Column(cf1b, cq1b, Bytes.of(cv1s))); RowColumn frc1 = rc1.following(); RowColumn rc2 = new RowColumn(rw2b, new Column(cf2b, cq2b, Bytes.of(cv2s))); RowColumn frc2 = rc2.following(); Assert.assertEquals(new Span(rc1, true, frc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b) .qual(cq1b).vis(cv1b).endRow(rw2b).fam(cf2b).qual(cq2b).vis(cv2b).build()); Assert.assertEquals(new Span(rc1, true, rc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b) .qual(cq1b).vis(cv1b).endRow(rw2b).fam(cf2b).qual(cq2b).vis(cv2b).exclusive().build()); Assert.assertEquals(new Span(frc1, true, frc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b).qual(cq1b).vis(cv1b).exclusive().endRow(rw2b) .fam(cf2b).qual(cq2b).vis(cv2b).build()); Assert.assertEquals(new Span(frc1, true, rc2, false), Span.newBuilder().startRow(rw1b).fam(cf1b).qual(cq1b).vis(cv1b).exclusive().endRow(rw2b) .fam(cf2b).qual(cq2b).vis(cv2b).exclusive().build()); }