@Test(expected = AssertionError.class) public void testTranslate() throws Exception { new LocationTranslator("Not.A.Location").translate(); }
@Override public Location translate() { if (this.location == null || this.location.isEmpty()) { return Location.OUTLET; } Location result; switch (this.location) { case "Inlet": result = Location.INLET; break; case "Outlet": result = Location.OUTLET; break; case "Body": result = Location.BODY; break; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", this.location)); } return result; }
LocationTranslator implements Translator<Location> { @Override public Location translate() { if (this.location == null || this.location.isEmpty()) { return Location.OUTLET; } Location result; switch (this.location) { case "Inlet": result = Location.INLET; break; case "Outlet": result = Location.OUTLET; break; case "Body": result = Location.BODY; break; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", this.location)); } return result; } }
LocationTranslator implements Translator<Location> { @Override public Location translate() { if (this.location == null || this.location.isEmpty()) { return Location.OUTLET; } Location result; switch (this.location) { case "Inlet": result = Location.INLET; break; case "Outlet": result = Location.OUTLET; break; case "Body": result = Location.BODY; break; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", this.location)); } return result; } LocationTranslator(String location); }
LocationTranslator implements Translator<Location> { @Override public Location translate() { if (this.location == null || this.location.isEmpty()) { return Location.OUTLET; } Location result; switch (this.location) { case "Inlet": result = Location.INLET; break; case "Outlet": result = Location.OUTLET; break; case "Body": result = Location.BODY; break; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", this.location)); } return result; } LocationTranslator(String location); @Override Location translate(); }
LocationTranslator implements Translator<Location> { @Override public Location translate() { if (this.location == null || this.location.isEmpty()) { return Location.OUTLET; } Location result; switch (this.location) { case "Inlet": result = Location.INLET; break; case "Outlet": result = Location.OUTLET; break; case "Body": result = Location.BODY; break; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", this.location)); } return result; } LocationTranslator(String location); @Override Location translate();  }