Search in sources :

Example 51 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project flytekit-java by flyteorg.

the class SdkBindingData method ofPrimitive.

public static SdkBindingData ofPrimitive(Primitive primitive) {
    BindingData bindingData = BindingData.ofScalar(Scalar.ofPrimitive(primitive));
    LiteralType literalType = LiteralType.ofSimpleType(getSimpleType(primitive.kind()));
    return create(bindingData, literalType);
}
Also used : LiteralType(org.flyte.api.v1.LiteralType) BindingData(org.flyte.api.v1.BindingData)

Example 52 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project flytekit-java by flyteorg.

the class TestingSdkWorkflowBuilder method inputOf.

@Override
public SdkBindingData inputOf(String name, LiteralType literalType, String help) {
    LiteralType fixedInputType = fixedInputTypeMap.get(name);
    Literal fixedInput = fixedInputMap.get(name);
    checkArgument(fixedInputType != null, "Fixed input [%s] (of type %s) isn't defined, use SdkTestingExecutor#withFixedInput", name, LiteralTypes.toPrettyString(literalType));
    checkArgument(fixedInputType.equals(literalType), "Fixed input [%s] (of type %s) doesn't match expected type %s", name, LiteralTypes.toPrettyString(fixedInputType), LiteralTypes.toPrettyString(literalType));
    return SdkBindingData.create(Literals.toBindingData(fixedInput), fixedInputType);
}
Also used : Literal(org.flyte.api.v1.Literal) LiteralType(org.flyte.api.v1.LiteralType)

Example 53 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method crosses.

@Override
public BinarySpatialOperator<Object> crosses(final Expression<Object, ?> geometry1, final Expression<Object, ?> geometry2) {
    PropertyNameType propertyName = null;
    if (geometry1 instanceof PropertyNameType) {
        propertyName = (PropertyNameType) geometry1;
    } else {
        throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + geometry1.getClass().getSimpleName());
    }
    // we transform the JTS geometry into a GML geometry
    Object geom = null;
    if (geometry2 instanceof LiteralType) {
        geom = ((LiteralType) geometry2).getValue();
        geom = GeometryToGML(geom);
    }
    return new CrossesType(propertyName, geom);
}
Also used : LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) CrossesType(org.geotoolkit.ogc.xml.v110.CrossesType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 54 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method greater.

@Override
public BinaryComparisonOperator<Object> greater(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    LiteralType lit = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
    }
    if (expr1 instanceof LiteralType) {
        lit = (LiteralType) expr1;
    } else if (expr2 instanceof LiteralType) {
        lit = (LiteralType) expr2;
    }
    return new PropertyIsGreaterThanType(lit, propName, null);
}
Also used : PropertyIsGreaterThanType(org.geotoolkit.ogc.xml.v110.PropertyIsGreaterThanType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 55 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method greaterOrEqual.

@Override
public BinaryComparisonOperator<Object> greaterOrEqual(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2, final boolean matchCase, final MatchAction action) {
    LiteralType lit = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
    }
    if (expr1 instanceof LiteralType) {
        lit = (LiteralType) expr1;
    } else if (expr2 instanceof LiteralType) {
        lit = (LiteralType) expr2;
    }
    return new PropertyIsGreaterThanOrEqualToType(lit, propName, matchCase);
}
Also used : LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyIsGreaterThanOrEqualToType(org.geotoolkit.ogc.xml.v110.PropertyIsGreaterThanOrEqualToType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Aggregations

JAXBElement (javax.xml.bind.JAXBElement)40 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)40 PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)40 Literal (org.opengis.filter.Literal)35 Marshaller (javax.xml.bind.Marshaller)34 Unmarshaller (javax.xml.bind.Unmarshaller)34 Test (org.junit.Test)34 ValueReference (org.opengis.filter.ValueReference)34 Filter (org.opengis.filter.Filter)26 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)21 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)17 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)16 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)14 FilterType (org.geotoolkit.ogc.xml.v100.FilterType)11 Expression (org.opengis.filter.Expression)11 LiteralType (org.flyte.api.v1.LiteralType)10 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType)9 ComparisonOpsType (org.geotoolkit.ogc.xml.v100.ComparisonOpsType)9 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v110.BinaryComparisonOpType)9 LogicalOperator (org.opengis.filter.LogicalOperator)9