public static Span prefix()

in modules/api/src/main/java/org/apache/fluo/api/data/Span.java [286:311]


  public static Span prefix(Bytes row, Column colPrefix) {
    Objects.requireNonNull(row);
    Objects.requireNonNull(colPrefix);
    Bytes cf = colPrefix.getFamily();
    Bytes cq = colPrefix.getQualifier();
    Bytes cv = colPrefix.getVisibility();

    if (colPrefix.isVisibilitySet()) {
      Bytes fp = followingPrefix(cv);
      RowColumn end = (fp == null ? new RowColumn(row, new Column(cf, cq)).following()
          : new RowColumn(row, new Column(cf, cq, fp)));
      return new Span(new RowColumn(row, colPrefix), true, end, false);
    } else if (colPrefix.isQualifierSet()) {
      Bytes fp = followingPrefix(cq);
      RowColumn end = (fp == null ? new RowColumn(row, new Column(cf)).following()
          : new RowColumn(row, new Column(cf, fp)));
      return new Span(new RowColumn(row, colPrefix), true, end, false);
    } else if (colPrefix.isFamilySet()) {
      Bytes fp = followingPrefix(cf);
      RowColumn end =
          (fp == null ? new RowColumn(row).following() : new RowColumn(row, new Column(fp)));
      return new Span(new RowColumn(row, colPrefix), true, end, false);
    } else {
      return prefix(row);
    }
  }