@Test public void testIsValidTemperature() { assertTrue("should be valid", isValidTemperature("*#4*0*0*0225##")); assertTrue("should be valid", isValidTemperature("*#4*00*0*0225##")); assertTrue("should be valid", isValidTemperature("*#4*899*0*0225##")); assertTrue("should be valid", isValidTemperature("*#4*XXXXXXXX##")); assertTrue("should be valid", isValidTemperature("*#4*XXXXXXXXXX##")); assertFalse("should be invalid", isValidTemperature("*#4*XXXXXXX##")); assertFalse("should be invalid", isValidTemperature("*#4*XXXXXXXXXXX##")); assertFalse("should be invalid", isValidTemperature("*#4*0*0##")); assertFalse("should be invalid", isValidTemperature("*#4*899*0##")); assertFalse("should be invalid", isValidTemperature(null)); assertFalse("should be invalid", isValidTemperature("")); }
static boolean isValidTemperature(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 17 && value.endsWith(FRAME_END); }
Heating extends BaseOpenMessage { static boolean isValidTemperature(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 17 && value.endsWith(FRAME_END); } }
Heating extends BaseOpenMessage { static boolean isValidTemperature(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 17 && value.endsWith(FRAME_END); } private  Heating(String value, TemperatureScale scale); }
Heating extends BaseOpenMessage { static boolean isValidTemperature(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 17 && value.endsWith(FRAME_END); } private  Heating(String value, TemperatureScale scale); static Heating requestTemperature(String where, TemperatureScale scale); static Heating requestTemperature(String where); static Func1<OpenSession, OpenSession> handleTemperature(Action1<Double> onSuccess, Action0 onError); }
Heating extends BaseOpenMessage { static boolean isValidTemperature(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 17 && value.endsWith(FRAME_END); } private  Heating(String value, TemperatureScale scale); static Heating requestTemperature(String where, TemperatureScale scale); static Heating requestTemperature(String where); static Func1<OpenSession, OpenSession> handleTemperature(Action1<Double> onSuccess, Action0 onError);  }