Search in sources :

Example 11 with LiteralExpressionImpl

use of org.geotools.filter.LiteralExpressionImpl in project ddf by codice.

the class OpenSearchQueryTest method verifyEqualsFilter.

private void verifyEqualsFilter(Filter filter, String expectedPropertyName, String expectedValue) {
    assertTrue(filter instanceof IsEqualsToImpl);
    IsEqualsToImpl equalsFilter = (IsEqualsToImpl) filter;
    AttributeExpressionImpl expression1 = (AttributeExpressionImpl) equalsFilter.getExpression1();
    LOGGER.debug("propertyName = {}", expression1.getPropertyName());
    assertEquals(expectedPropertyName, expression1.getPropertyName());
    LiteralExpressionImpl expression2 = (LiteralExpressionImpl) equalsFilter.getExpression2();
    LOGGER.debug("version to search for = {}", expression2.getValue());
    assertEquals(expectedValue, expression2.getValue());
}
Also used : AttributeExpressionImpl(org.geotools.filter.AttributeExpressionImpl) LiteralExpressionImpl(org.geotools.filter.LiteralExpressionImpl) IsEqualsToImpl(org.geotools.filter.IsEqualsToImpl)

Aggregations

LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)11 AttributeType (ddf.catalog.data.AttributeType)7 Expression (org.opengis.filter.expression.Expression)7 Date (java.util.Date)4 Literal (org.opengis.filter.expression.Literal)4 AttributeExpressionImpl (org.geotools.filter.AttributeExpressionImpl)3 ContentTypePredicate (ddf.catalog.pubsub.predicate.ContentTypePredicate)2 ContextualPredicate (ddf.catalog.pubsub.predicate.ContextualPredicate)2 EntryPredicate (ddf.catalog.pubsub.predicate.EntryPredicate)2 GeospatialPredicate (ddf.catalog.pubsub.predicate.GeospatialPredicate)2 Predicate (ddf.catalog.pubsub.predicate.Predicate)2 TemporalPredicate (ddf.catalog.pubsub.predicate.TemporalPredicate)2 DefaultInstant (org.geotools.temporal.object.DefaultInstant)2 DefaultPeriod (org.geotools.temporal.object.DefaultPeriod)2 DefaultPosition (org.geotools.temporal.object.DefaultPosition)2 Instant (org.opengis.temporal.Instant)2 Geometry (com.vividsolutions.jts.geom.Geometry)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 GeoFormatException (org.codice.ddf.libs.geo.GeoFormatException)1