@Test(expected = IllegalArgumentException.class) public void testSetIterators_DuplicatePriority() { IteratorSetting[] iterators = {new IteratorSetting(1, "first", "someclass"), new IteratorSetting(2, "second", "someotherclass"), new IteratorSetting(1, "third", "yetanotherclass")}; c.setIterators(iterators); }
public Condition setIterators(IteratorSetting... iterators) { checkArgument(iterators != null, "iterators is null"); if (iterators.length > 1) { HashSet<String> names = new HashSet<>(); HashSet<Integer> prios = new HashSet<>(); for (IteratorSetting iteratorSetting : iterators) { if (!names.add(iteratorSetting.getName())) throw new IllegalArgumentException( "iterator name used more than once " + iteratorSetting.getName()); if (!prios.add(iteratorSetting.getPriority())) throw new IllegalArgumentException( "iterator priority used more than once " + iteratorSetting.getPriority()); } } this.iterators = iterators; return this; }
Condition { public Condition setIterators(IteratorSetting... iterators) { checkArgument(iterators != null, "iterators is null"); if (iterators.length > 1) { HashSet<String> names = new HashSet<>(); HashSet<Integer> prios = new HashSet<>(); for (IteratorSetting iteratorSetting : iterators) { if (!names.add(iteratorSetting.getName())) throw new IllegalArgumentException( "iterator name used more than once " + iteratorSetting.getName()); if (!prios.add(iteratorSetting.getPriority())) throw new IllegalArgumentException( "iterator priority used more than once " + iteratorSetting.getPriority()); } } this.iterators = iterators; return this; } }
Condition { public Condition setIterators(IteratorSetting... iterators) { checkArgument(iterators != null, "iterators is null"); if (iterators.length > 1) { HashSet<String> names = new HashSet<>(); HashSet<Integer> prios = new HashSet<>(); for (IteratorSetting iteratorSetting : iterators) { if (!names.add(iteratorSetting.getName())) throw new IllegalArgumentException( "iterator name used more than once " + iteratorSetting.getName()); if (!prios.add(iteratorSetting.getPriority())) throw new IllegalArgumentException( "iterator priority used more than once " + iteratorSetting.getPriority()); } } this.iterators = iterators; return this; } Condition(CharSequence cf, CharSequence cq);  Condition(byte[] cf, byte[] cq);  Condition(Text cf, Text cq);  Condition(ByteSequence cf, ByteSequence cq); }
Condition { public Condition setIterators(IteratorSetting... iterators) { checkArgument(iterators != null, "iterators is null"); if (iterators.length > 1) { HashSet<String> names = new HashSet<>(); HashSet<Integer> prios = new HashSet<>(); for (IteratorSetting iteratorSetting : iterators) { if (!names.add(iteratorSetting.getName())) throw new IllegalArgumentException( "iterator name used more than once " + iteratorSetting.getName()); if (!prios.add(iteratorSetting.getPriority())) throw new IllegalArgumentException( "iterator priority used more than once " + iteratorSetting.getPriority()); } } this.iterators = iterators; return this; } Condition(CharSequence cf, CharSequence cq);  Condition(byte[] cf, byte[] cq);  Condition(Text cf, Text cq);  Condition(ByteSequence cf, ByteSequence cq); ByteSequence getFamily(); ByteSequence getQualifier(); Condition setTimestamp(long ts); Long getTimestamp(); Condition setValue(CharSequence value); Condition setValue(byte[] value); Condition setValue(Text value); Condition setValue(ByteSequence value); ByteSequence getValue(); Condition setVisibility(ColumnVisibility cv); ByteSequence getVisibility(); Condition setIterators(IteratorSetting... iterators); IteratorSetting[] getIterators(); @Override boolean equals(Object o); @Override int hashCode(); }
Condition { public Condition setIterators(IteratorSetting... iterators) { checkArgument(iterators != null, "iterators is null"); if (iterators.length > 1) { HashSet<String> names = new HashSet<>(); HashSet<Integer> prios = new HashSet<>(); for (IteratorSetting iteratorSetting : iterators) { if (!names.add(iteratorSetting.getName())) throw new IllegalArgumentException( "iterator name used more than once " + iteratorSetting.getName()); if (!prios.add(iteratorSetting.getPriority())) throw new IllegalArgumentException( "iterator priority used more than once " + iteratorSetting.getPriority()); } } this.iterators = iterators; return this; } Condition(CharSequence cf, CharSequence cq);  Condition(byte[] cf, byte[] cq);  Condition(Text cf, Text cq);  Condition(ByteSequence cf, ByteSequence cq); ByteSequence getFamily(); ByteSequence getQualifier(); Condition setTimestamp(long ts); Long getTimestamp(); Condition setValue(CharSequence value); Condition setValue(byte[] value); Condition setValue(Text value); Condition setValue(ByteSequence value); ByteSequence getValue(); Condition setVisibility(ColumnVisibility cv); ByteSequence getVisibility(); Condition setIterators(IteratorSetting... iterators); IteratorSetting[] getIterators(); @Override boolean equals(Object o); @Override int hashCode();  }