@Test public void testValidateKey() { String[] validKeys = new String[]{"2015cthar:12", "2015necmp:1"}; String[] invalidKeys = new String[]{"asldf:5", "2015cthar:foo", "2015cthar", null}; for (String key : validKeys) { assertTrue(AwardHelper.validateAwardKey(key)); } for (String key : invalidKeys) { assertFalse(AwardHelper.validateAwardKey(key)); } }
public static boolean validateAwardKey(String key) { if (key == null) return false; String[] split = key.split(":"); return split.length == 2 && EventHelper.validateEventKey(split[0]) && Utilities.isInteger(split[1]); }
AwardHelper { public static boolean validateAwardKey(String key) { if (key == null) return false; String[] split = key.split(":"); return split.length == 2 && EventHelper.validateEventKey(split[0]) && Utilities.isInteger(split[1]); } }
AwardHelper { public static boolean validateAwardKey(String key) { if (key == null) return false; String[] split = key.split(":"); return split.length == 2 && EventHelper.validateEventKey(split[0]) && Utilities.isInteger(split[1]); } private  AwardHelper(); }
AwardHelper { public static boolean validateAwardKey(String key) { if (key == null) return false; String[] split = key.split(":"); return split.length == 2 && EventHelper.validateEventKey(split[0]) && Utilities.isInteger(split[1]); } private  AwardHelper(); static boolean validateAwardKey(String key); static String createAwardKey(String eventKey, int awardEnum); }
AwardHelper { public static boolean validateAwardKey(String key) { if (key == null) return false; String[] split = key.split(":"); return split.length == 2 && EventHelper.validateEventKey(split[0]) && Utilities.isInteger(split[1]); } private  AwardHelper(); static boolean validateAwardKey(String key); static String createAwardKey(String eventKey, int awardEnum);  }