private void checkDuplicateFunctionExist(FunctionDefinition functionDefinition) { if (this.functionDefinitionMap.get(functionDefinition.getId()) != null) { throw new DuplicateDefinitionException("The function definition with the same id exists " + functionDefinition.getId(), functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } }
public void defineFunction(FunctionDefinition functionDefinition) { if (functionDefinition == null) { throw new SiddhiAppValidationException("Function Definition should not be null"); } else if (functionDefinition.getId() == null) { throw new SiddhiAppValidationException("Function Id should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } else if (functionDefinition.getReturnType() == null) { throw new SiddhiAppValidationException("Return type should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } else if (functionDefinition.getBody() == null) { throw new SiddhiAppValidationException("Body should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } else if (functionDefinition.getLanguage() == null) { throw new SiddhiAppValidationException("Language should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } checkDuplicateFunctionExist(functionDefinition); this.functionDefinitionMap.put(functionDefinition.getId(), functionDefinition); }
private void checkDuplicateFunctionExist(FunctionDefinition functionDefinition) { if (this.functionDefinitionMap.get(functionDefinition.getId()) != null) { throw new DuplicateDefinitionException("The function definition with the same id exists " + functionDefinition.getId(), functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } }
public void defineFunction(FunctionDefinition functionDefinition) { if (functionDefinition == null) { throw new SiddhiAppValidationException("Function Definition should not be null"); } else if (functionDefinition.getId() == null) { throw new SiddhiAppValidationException("Function Id should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } else if (functionDefinition.getReturnType() == null) { throw new SiddhiAppValidationException("Return type should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } else if (functionDefinition.getBody() == null) { throw new SiddhiAppValidationException("Body should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } else if (functionDefinition.getLanguage() == null) { throw new SiddhiAppValidationException("Language should not be null for Function Definition", functionDefinition.getQueryContextStartIndex(), functionDefinition.getQueryContextEndIndex()); } checkDuplicateFunctionExist(functionDefinition); this.functionDefinitionMap.put(functionDefinition.getId(), functionDefinition); }