public static Predicate < Read > getStrictReadPredicate ( final long start , final String fields ) { Preconditions . checkArgument ( Strings . isNullOrEmpty ( fields ) || READ_FIELD_PATTERN . matcher ( fields ) . matches ( ) , "Insufficient fields requested in partial response. At a minimum " + "include 'alignments(alignment)' to enforce a strict shard boundary." ) ; return new Predicate < Read > ( ) { @ Override public boolean apply ( Read read ) { return read . getAlignment ( ) . getPosition ( ) . getPosition ( ) >= start ; } } ; }
Predicate expressing the logic for which reads should and should not be included in the shard .