@Test(expectedExceptions = IllegalArgumentException.class) public void cantCreateUnknownPhase() { new MantaJobPhase().setType("anything else"); }
public MantaJobPhase setType(final String type) { Validate.notNull(type, "Type must not be null"); if (!(type.equals("map") || type.equals("reduce"))) { throw new IllegalArgumentException("Type must equal map or reduce"); } this.type = type; return this; }
MantaJobPhase { public MantaJobPhase setType(final String type) { Validate.notNull(type, "Type must not be null"); if (!(type.equals("map") || type.equals("reduce"))) { throw new IllegalArgumentException("Type must equal map or reduce"); } this.type = type; return this; } }
MantaJobPhase { public MantaJobPhase setType(final String type) { Validate.notNull(type, "Type must not be null"); if (!(type.equals("map") || type.equals("reduce"))) { throw new IllegalArgumentException("Type must equal map or reduce"); } this.type = type; return this; } MantaJobPhase(); }
MantaJobPhase { public MantaJobPhase setType(final String type) { Validate.notNull(type, "Type must not be null"); if (!(type.equals("map") || type.equals("reduce"))) { throw new IllegalArgumentException("Type must equal map or reduce"); } this.type = type; return this; } MantaJobPhase(); String getExec(); MantaJobPhase setExec(final String exec); String getType(); MantaJobPhase setType(final String type); List<String> getAssets(); MantaJobPhase setAssets(final List<String> assets); String getInit(); MantaJobPhase setInit(final String init); Integer getCount(); MantaJobPhase setCount(final Integer count); Integer getMemory(); MantaJobPhase setMemory(final Integer memory); Integer getDisk(); MantaJobPhase setDisk(final Integer disk); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
MantaJobPhase { public MantaJobPhase setType(final String type) { Validate.notNull(type, "Type must not be null"); if (!(type.equals("map") || type.equals("reduce"))) { throw new IllegalArgumentException("Type must equal map or reduce"); } this.type = type; return this; } MantaJobPhase(); String getExec(); MantaJobPhase setExec(final String exec); String getType(); MantaJobPhase setType(final String type); List<String> getAssets(); MantaJobPhase setAssets(final List<String> assets); String getInit(); MantaJobPhase setInit(final String init); Integer getCount(); MantaJobPhase setCount(final Integer count); Integer getMemory(); MantaJobPhase setMemory(final Integer memory); Integer getDisk(); MantaJobPhase setDisk(final Integer disk); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }