@Test public void shouldConvertToCorrectWeightClass(){ WeightClass bad = WeightClassificationUtils.verticalWeightToClass("0"); WeightClass ok = WeightClassificationUtils.verticalWeightToClass("1"); WeightClass good = WeightClassificationUtils.verticalWeightToClass("2"); assertThat(bad).isEqualTo(WeightClass.BAD); assertThat(ok).isEqualTo(WeightClass.OK); assertThat(good).isEqualTo(WeightClass.GOOD); }
public static WeightClass verticalWeightToClass(String verticalClass) { if (verticalClass.contains("2")) { return WeightClass.GOOD; } else if (verticalClass.contains("1")) { return WeightClass.OK; } else if (verticalClass.contains("0")) { return WeightClass.BAD; } throw new RuntimeException("CANNOT CAST verticalClass string to ENUM"); }
WeightClassificationUtils { public static WeightClass verticalWeightToClass(String verticalClass) { if (verticalClass.contains("2")) { return WeightClass.GOOD; } else if (verticalClass.contains("1")) { return WeightClass.OK; } else if (verticalClass.contains("0")) { return WeightClass.BAD; } throw new RuntimeException("CANNOT CAST verticalClass string to ENUM"); } }
WeightClassificationUtils { public static WeightClass verticalWeightToClass(String verticalClass) { if (verticalClass.contains("2")) { return WeightClass.GOOD; } else if (verticalClass.contains("1")) { return WeightClass.OK; } else if (verticalClass.contains("0")) { return WeightClass.BAD; } throw new RuntimeException("CANNOT CAST verticalClass string to ENUM"); }  }
WeightClassificationUtils { public static WeightClass verticalWeightToClass(String verticalClass) { if (verticalClass.contains("2")) { return WeightClass.GOOD; } else if (verticalClass.contains("1")) { return WeightClass.OK; } else if (verticalClass.contains("0")) { return WeightClass.BAD; } throw new RuntimeException("CANNOT CAST verticalClass string to ENUM"); }  static WeightClass verticalWeightToClass(String verticalClass); static WeightClass eqResponseToWeightClass(EqWeightResponse eqWeightResponse); static WeightClass weightLowEqRegister(EqWeightResponse eqWeightResponse); static WeightClass weightMidEqRegister(EqWeightResponse eqWeightResponse); static WeightClass weightHiEqRegister(EqWeightResponse eqWeightResponse); static boolean isLowEqRegister(Ratings rating); static boolean isMidEqRegister(Ratings rating); static boolean isHiEqRegister(Ratings rating); }
WeightClassificationUtils { public static WeightClass verticalWeightToClass(String verticalClass) { if (verticalClass.contains("2")) { return WeightClass.GOOD; } else if (verticalClass.contains("1")) { return WeightClass.OK; } else if (verticalClass.contains("0")) { return WeightClass.BAD; } throw new RuntimeException("CANNOT CAST verticalClass string to ENUM"); }  static WeightClass verticalWeightToClass(String verticalClass); static WeightClass eqResponseToWeightClass(EqWeightResponse eqWeightResponse); static WeightClass weightLowEqRegister(EqWeightResponse eqWeightResponse); static WeightClass weightMidEqRegister(EqWeightResponse eqWeightResponse); static WeightClass weightHiEqRegister(EqWeightResponse eqWeightResponse); static boolean isLowEqRegister(Ratings rating); static boolean isMidEqRegister(Ratings rating); static boolean isHiEqRegister(Ratings rating);  }