本文整理汇总了Java中org.wso2.siddhi.query.api.definition.StreamDefinition.equals方法的典型用法代码示例。如果您正苦于以下问题:Java StreamDefinition.equals方法的具体用法?Java StreamDefinition.equals怎么用?Java StreamDefinition.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wso2.siddhi.query.api.definition.StreamDefinition
的用法示例。
在下文中一共展示了StreamDefinition.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defineStream
import org.wso2.siddhi.query.api.definition.StreamDefinition; //导入方法依赖的package包/类
public ExecutionPlan defineStream(StreamDefinition streamDefinition) {
if (streamDefinition == null) {
throw new ExecutionPlanValidationException("Stream Definition should not be null");
} else if (streamDefinition.getId() == null) {
throw new ExecutionPlanValidationException("Stream Id should not be null for Stream Definition");
}
StreamDefinition existingStreamDefinition = streamDefinitionMap.get(streamDefinition.getId());
if (existingStreamDefinition != null && !existingStreamDefinition.equals(streamDefinition)) {
throw new ExecutionPlanValidationException("Stream Definition with same Stream Id " +
streamDefinition.getId() + " already exist : " + existingStreamDefinition +
", hence cannot add " + streamDefinition);
} else {
this.streamDefinitionMap.put(streamDefinition.getId(), streamDefinition);
}
return this;
}
示例2: checkDuplicateDefinition
import org.wso2.siddhi.query.api.definition.StreamDefinition; //导入方法依赖的package包/类
private void checkDuplicateDefinition(AbstractDefinition definition) {
TableDefinition existingTableDefinition = tableDefinitionMap.get(definition.getId());
if (existingTableDefinition != null && (!existingTableDefinition.equals(definition) || definition instanceof
StreamDefinition)) {
throw new DuplicateDefinitionException("Table Definition with same Stream Id '" +
definition.getId() + "' already exist : " + existingTableDefinition +
", hence cannot add " + definition, definition.getQueryContextStartIndex(),
definition.getQueryContextEndIndex());
}
StreamDefinition existingStreamDefinition = streamDefinitionMap.get(definition.getId());
if (existingStreamDefinition != null && (!existingStreamDefinition.equals(definition) || definition
instanceof TableDefinition)) {
throw new DuplicateDefinitionException("Stream Definition with same Stream Id '" +
definition.getId() + "' already exist : " + existingStreamDefinition +
", hence cannot add " + definition, definition.getQueryContextStartIndex(),
definition.getQueryContextEndIndex());
}
WindowDefinition existingWindowDefinition = windowDefinitionMap.get(definition.getId());
if (existingWindowDefinition != null && (!existingWindowDefinition.equals(definition) || definition
instanceof WindowDefinition)) {
throw new DuplicateDefinitionException("Stream Definition with same Window Id '" +
definition.getId() + "' already exist : " + existingWindowDefinition +
", hence cannot add " + definition, definition.getQueryContextStartIndex(),
definition.getQueryContextEndIndex());
}
AggregationDefinition existingAggregationDefinition = aggregationDefinitionMap.get(definition.getId());
if (existingAggregationDefinition != null
&& (!existingAggregationDefinition.equals(definition) || definition instanceof AggregationDefinition)) {
throw new DuplicateDefinitionException("Aggregate Definition with same Aggregate Id '" + definition.getId()
+ "' already exist : " + existingAggregationDefinition + ", hence cannot add " + definition,
definition.getQueryContextStartIndex(), definition.getQueryContextEndIndex());
}
}
示例3: validate
import org.wso2.siddhi.query.api.definition.StreamDefinition; //导入方法依赖的package包/类
/**
* Method to validate stream definition
*
* @param definitionList List of existing definitions
* @param newDefinition New definitions which needs to be validated
* @throws org.wso2.siddhi.core.exception.ValidatorException Thrown if validation is failed
*/
public static void validate(List<StreamDefinition> definitionList, StreamDefinition newDefinition) throws ValidatorException {
for (StreamDefinition definition : definitionList) {
if ((definition.getId().equals(newDefinition.getId())) && !definition.equals(newDefinition)) {
throw new ValidatorException("Different stream definition already exist under stream name " + newDefinition.getId());
}
}
}
示例4: validate
import org.wso2.siddhi.query.api.definition.StreamDefinition; //导入方法依赖的package包/类
/**
* Method to validate stream definition
*
* @param definitionList List of existing definitions
* @param newDefinition New definitions which needs to be validated
* @throws ValidatorException Thrown if validation is failed
*/
public static void validate(List<StreamDefinition> definitionList, StreamDefinition newDefinition) throws ValidatorException {
for (StreamDefinition definition : definitionList) {
if ((definition.getId().equals(newDefinition.getId())) && !definition.equals(newDefinition)) {
throw new ValidatorException("Different stream definition already exist under stream name " + newDefinition.getId());
}
}
}