@Test(expected = IllegalArgumentException.class) public void testBadRange2() { LoadPlan.builder().loadFileTo("f1.rf", RangeType.TABLE, "b", "a").build(); }
public static Builder builder() { return new Builder() { ImmutableList.Builder<Destination> fmb = ImmutableList.builder(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { return new LoadPlan(fmb.build()); } }; }
LoadPlan { public static Builder builder() { return new Builder() { ImmutableList.Builder<Destination> fmb = ImmutableList.builder(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { return new LoadPlan(fmb.build()); } }; } }
LoadPlan { public static Builder builder() { return new Builder() { ImmutableList.Builder<Destination> fmb = ImmutableList.builder(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { return new LoadPlan(fmb.build()); } }; } private  LoadPlan(List<Destination> destinations); }
LoadPlan { public static Builder builder() { return new Builder() { ImmutableList.Builder<Destination> fmb = ImmutableList.builder(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { return new LoadPlan(fmb.build()); } }; } private  LoadPlan(List<Destination> destinations); Collection<Destination> getDestinations(); static Builder builder(); }
LoadPlan { public static Builder builder() { return new Builder() { ImmutableList.Builder<Destination> fmb = ImmutableList.builder(); @Override public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, byte[] startRow, byte[] endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder loadFileTo(String fileName, RangeType rangeType, CharSequence startRow, CharSequence endRow) { fmb.add(new Destination(fileName, rangeType, copy(startRow), copy(endRow))); return this; } @Override public Builder addPlan(LoadPlan plan) { fmb.addAll(plan.getDestinations()); return this; } @Override public LoadPlan build() { return new LoadPlan(fmb.build()); } }; } private  LoadPlan(List<Destination> destinations); Collection<Destination> getDestinations(); static Builder builder();  }