@Test public void testInvalidEventNameDollar() { assertFalse( "Event name with $", LQEvent.hasValidName("custo$m_event", false) ); }
public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.exceptionOrLog(raiseException, "Event name cannot start with \'_\' and cannot contain invalid chars: (. $ \\0)"); } return valid; }
LQEvent extends LQModel { public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.exceptionOrLog(raiseException, "Event name cannot start with \'_\' and cannot contain invalid chars: (. $ \\0)"); } return valid; } }
LQEvent extends LQModel { public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.exceptionOrLog(raiseException, "Event name cannot start with \'_\' and cannot contain invalid chars: (. $ \\0)"); } return valid; } LQEvent(String name, HashMap<String,Object> attributes, Date date);  LQEvent(String name, HashMap<String,Object> attributes); }
LQEvent extends LQModel { public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.exceptionOrLog(raiseException, "Event name cannot start with \'_\' and cannot contain invalid chars: (. $ \\0)"); } return valid; } LQEvent(String name, HashMap<String,Object> attributes, Date date);  LQEvent(String name, HashMap<String,Object> attributes); void setName(String name); String getName(); JSONObject toJSON(); static boolean hasValidName(String name, boolean raiseException); }
LQEvent extends LQModel { public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.exceptionOrLog(raiseException, "Event name cannot start with \'_\' and cannot contain invalid chars: (. $ \\0)"); } return valid; } LQEvent(String name, HashMap<String,Object> attributes, Date date);  LQEvent(String name, HashMap<String,Object> attributes); void setName(String name); String getName(); JSONObject toJSON(); static boolean hasValidName(String name, boolean raiseException); static final String UNNAMED_EVENT; }