public SlicePredicate toThrift ( ) { SlicePredicate pred = new SlicePredicate ( ) ; switch ( predicateType ) { case ColumnNames : if ( columnNames == null ) { return null ; } pred . setColumn_names ( toThriftColumnNames ( columnNames ) ) ; break ; case Range : Assert . isTrue ( countSet , "Count was not set, neither were column-names set, can't execute" ) ; SliceRange range = new SliceRange ( findBytes ( start ) , findBytes ( finish ) , reversed , count ) ; pred . setSlice_range ( range ) ; break ; case Unknown : default : throw new HectorException ( "Neither column names nor range were set, this is an invalid slice predicate" ) ; } return pred ; }
Will throw a runtime exception if neither columnsNames nor count were set .