当前位置: 首页>>代码示例>>Java>>正文


Java Operator类代码示例

本文整理汇总了Java中org.openhab.core.persistence.FilterCriteria.Operator的典型用法代码示例。如果您正苦于以下问题:Java Operator类的具体用法?Java Operator怎么用?Java Operator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Operator类属于org.openhab.core.persistence.FilterCriteria包,在下文中一共展示了Operator类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
private String convertOperator(Operator operator) {
	switch (operator) {
	case EQ:
		return "$eq";
	case GT:
		return "$gt";
	case GTE:
		return "$gte";
	case LT:
		return "$lt";
	case LTE:
		return "$lte";
	case NEQ:
		return "$neq";
	default:
		return null;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:19,代码来源:MongoDBPersistenceService.java

示例2: operatorAsString

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
/**
 * Convert op to string suitable for dynamodb filter expression
 *
 * @param op
 * @return string representation corresponding to the given the Operator
 */
private static String operatorAsString(Operator op) {
    switch (op) {
        case EQ:
            return "=";
        case NEQ:
            return "<>";
        case LT:
            return "<";
        case LTE:
            return "<=";
        case GT:
            return ">";
        case GTE:
            return ">=";

        default:
            throw new IllegalStateException("Unknown operator " + op);
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:26,代码来源:DynamoDBPersistenceService.java

示例3: convertOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
private String convertOperator(Operator operator) {
    switch (operator) {
        case EQ:
            return "$eq";
        case GT:
            return "$gt";
        case GTE:
            return "$gte";
        case LT:
            return "$lt";
        case LTE:
            return "$lte";
        case NEQ:
            return "$neq";
        default:
            return null;
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:19,代码来源:MongoDBPersistenceService.java

示例4: testQueryUsingNameAndStartAndEndWithNEQOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithNEQOperator() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.NEQ);
    criteria.setState(getSecondItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    HistoricItem actual1 = iterator.next();
    assertFalse(iterator.hasNext());
    assertStateEquals(getFirstItemState(), actual1.getState());
    assertTrue(actual1.getTimestamp().before(afterStore1));
    assertTrue(actual1.getTimestamp().after(beforeStore));
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:17,代码来源:AbstractTwoItemIntegrationTest.java

示例5: testQueryUsingNameAndStartAndEndWithEQOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithEQOperator() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.EQ);
    criteria.setState(getFirstItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    HistoricItem actual1 = iterator.next();
    assertFalse(iterator.hasNext());
    assertStateEquals(getFirstItemState(), actual1.getState());
    assertTrue(actual1.getTimestamp().before(afterStore1));
    assertTrue(actual1.getTimestamp().after(beforeStore));
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:17,代码来源:AbstractTwoItemIntegrationTest.java

示例6: testQueryUsingNameAndStartAndEndWithLTOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithLTOperator() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.LT);
    criteria.setState(getSecondItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    HistoricItem actual1 = iterator.next();
    assertFalse(iterator.hasNext());
    assertStateEquals(getFirstItemState(), actual1.getState());
    assertTrue(actual1.getTimestamp().before(afterStore1));
    assertTrue(actual1.getTimestamp().after(beforeStore));
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:17,代码来源:AbstractTwoItemIntegrationTest.java

示例7: testQueryUsingNameAndStartAndEndWithLTEOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithLTEOperator() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.LTE);
    criteria.setState(getFirstItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    HistoricItem actual1 = iterator.next();
    assertFalse(iterator.hasNext());
    assertStateEquals(getFirstItemState(), actual1.getState());
    assertTrue(actual1.getTimestamp().before(afterStore1));
    assertTrue(actual1.getTimestamp().after(beforeStore));
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:17,代码来源:AbstractTwoItemIntegrationTest.java

示例8: testQueryUsingNameAndStartAndEndWithGTOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithGTOperator() {
    // Skip for subclasses which have null "state between"
    Assume.assumeTrue(getQueryItemStateBetween() != null);

    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.GT);
    criteria.setState(getQueryItemStateBetween());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    HistoricItem actual1 = iterator.next();
    assertFalse(iterator.hasNext());
    assertStateEquals(getSecondItemState(), actual1.getState());
    assertTrue(actual1.getTimestamp().before(afterStore2));
    assertTrue(actual1.getTimestamp().after(afterStore1));
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:20,代码来源:AbstractTwoItemIntegrationTest.java

示例9: testQueryUsingNameAndStartAndEndWithGTEOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithGTEOperator() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.GTE);
    criteria.setState(getSecondItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    HistoricItem actual1 = iterator.next();
    assertFalse(iterator.hasNext());
    assertStateEquals(getSecondItemState(), actual1.getState());
    assertTrue(actual1.getTimestamp().before(afterStore2));
    assertTrue(actual1.getTimestamp().after(afterStore1));
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:17,代码来源:AbstractTwoItemIntegrationTest.java

示例10: testQueryUsingNameAndStartAndEndWithLTOperatorNoMatch

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithLTOperatorNoMatch() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.LT);
    criteria.setState(getFirstItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    assertFalse(iterator.hasNext());
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:13,代码来源:AbstractTwoItemIntegrationTest.java

示例11: testQueryUsingNameAndStartAndEndWithGTOperatorNoMatch

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
@Test
public void testQueryUsingNameAndStartAndEndWithGTOperatorNoMatch() {
    FilterCriteria criteria = new FilterCriteria();
    criteria.setOperator(Operator.GT);
    criteria.setState(getSecondItemState());
    criteria.setItemName(getItemName());
    criteria.setBeginDate(beforeStore);
    criteria.setEndDate(afterStore2);
    Iterable<HistoricItem> iterable = BaseIntegrationTest.service.query(criteria);
    Iterator<HistoricItem> iterator = iterable.iterator();
    assertFalse(iterator.hasNext());
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:13,代码来源:AbstractTwoItemIntegrationTest.java

示例12: mapOperator

import org.openhab.core.persistence.FilterCriteria.Operator; //导入依赖的package包/类
private Operator mapOperator(FilterCriteria.Operator operator) {
	if(operator==null) return null;
	return org.openhab.core.persistence.FilterCriteria.Operator.valueOf(operator.toString());
}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:5,代码来源:QueryablePersistenceServiceDelegate.java


注:本文中的org.openhab.core.persistence.FilterCriteria.Operator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。