@Test public void testIsValidPower() { assertTrue("should be valid", isValidPower("*#18*51*54*X##")); assertTrue("should be valid", isValidPower("*#18*7255#0*113*XXXXXXX##")); assertTrue("should be valid", isValidPower("*#18*XXXXXXX##")); assertFalse("should be invalid", isValidPower("*#18*51*54*##")); assertFalse("should be invalid", isValidPower("*#18*7255#0*113*XXXXXXXX##")); assertFalse("should be invalid", isValidPower("*#18*51*54*XXX")); assertFalse("should be invalid", isValidPower("*#19*51*54*X##")); assertFalse("should be invalid", isValidPower(null)); assertFalse("should be invalid", isValidPower("")); }
static boolean isValidPower(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 26 && value.endsWith(FRAME_END); }
EnergyManagement extends BaseOpenMessage { static boolean isValidPower(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 26 && value.endsWith(FRAME_END); } }
EnergyManagement extends BaseOpenMessage { static boolean isValidPower(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 26 && value.endsWith(FRAME_END); } private  EnergyManagement(String value); }
EnergyManagement extends BaseOpenMessage { static boolean isValidPower(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 26 && value.endsWith(FRAME_END); } private  EnergyManagement(String value); static EnergyManagement requestInstantaneousPower(String where, Version version); static EnergyManagement requestDailyPower(String where, Version version); static EnergyManagement requestMonthlyPower(String where, Version version); static Func1<List<OpenSession>, List<OpenSession>> handlePowers(Action1<List<String>> onSuccess, Action0 onError); }
EnergyManagement extends BaseOpenMessage { static boolean isValidPower(String value) { return value != null && value.startsWith(format(FORMAT_PREFIX_DIMENSION, WHO)) && value.length() > 13 && value.length() < 26 && value.endsWith(FRAME_END); } private  EnergyManagement(String value); static EnergyManagement requestInstantaneousPower(String where, Version version); static EnergyManagement requestDailyPower(String where, Version version); static EnergyManagement requestMonthlyPower(String where, Version version); static Func1<List<OpenSession>, List<OpenSession>> handlePowers(Action1<List<String>> onSuccess, Action0 onError);  }