@Test public void testCreateFieldOptionsSingle() { Filter restriction = FeatureTypes.createFieldOptions(Arrays.asList("a")); FilterFactory ff = CommonFactoryFinder.getFilterFactory(null); PropertyName thisProperty = ff.property("."); Filter expected = ff.equal(thisProperty, ff.literal("a"), true); assertEquals(expected, restriction); }
public static Filter createFieldOptions(Collection<?> options) { if (options == null || options.isEmpty()) { return null; } PropertyName thisProperty = FF.property("."); List<Filter> filters = options.stream() .map(o -> FF.equal(thisProperty, FF.literal(o), false)) .collect(Collectors.toList()); if (filters.size() == 1) { return filters.get(0); } else { return FF.or(filters); } }
FeatureTypes { public static Filter createFieldOptions(Collection<?> options) { if (options == null || options.isEmpty()) { return null; } PropertyName thisProperty = FF.property("."); List<Filter> filters = options.stream() .map(o -> FF.equal(thisProperty, FF.literal(o), false)) .collect(Collectors.toList()); if (filters.size() == 1) { return filters.get(0); } else { return FF.or(filters); } } }
FeatureTypes { public static Filter createFieldOptions(Collection<?> options) { if (options == null || options.isEmpty()) { return null; } PropertyName thisProperty = FF.property("."); List<Filter> filters = options.stream() .map(o -> FF.equal(thisProperty, FF.literal(o), false)) .collect(Collectors.toList()); if (filters.size() == 1) { return filters.get(0); } else { return FF.or(filters); } }  }
FeatureTypes { public static Filter createFieldOptions(Collection<?> options) { if (options == null || options.isEmpty()) { return null; } PropertyName thisProperty = FF.property("."); List<Filter> filters = options.stream() .map(o -> FF.equal(thisProperty, FF.literal(o), false)) .collect(Collectors.toList()); if (filters.size() == 1) { return filters.get(0); } else { return FF.or(filters); } }  static Filter createLengthRestriction(int length); static int getFieldLength(PropertyDescriptor descriptor); static List<?> getFieldOptions(PropertyDescriptor descriptor); static Filter createFieldOptions(Collection<?> options); static SimpleFeatureType transform(
            SimpleFeatureType schema, CoordinateReferenceSystem crs); static SimpleFeatureType transform(
            SimpleFeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing); static SimpleFeature transform(
            SimpleFeature feature, SimpleFeatureType schema, MathTransform transform); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types,
            String name,
            URI ns,
            boolean isAbstract,
            SimpleFeatureType[] superTypes); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types,
            String name,
            URI ns,
            boolean isAbstract,
            SimpleFeatureType[] superTypes,
            AttributeDescriptor defaultGeometry); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types,
            String name,
            URI ns,
            boolean isAbstract,
            SimpleFeatureType[] superTypes,
            GeometryDescriptor defaultGeometry); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types, String name, URI ns, boolean isAbstract); static SimpleFeatureType newFeatureType(AttributeDescriptor[] types, String name, URI ns); static SimpleFeatureType newFeatureType(AttributeDescriptor[] types, String name); static List<FeatureType> getAncestors(FeatureType featureType); static boolean matches(FeatureType featureType, Name name); static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName); static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType); static boolean equals(SimpleFeatureType typeA, SimpleFeatureType typeB); static boolean equalsExact(SimpleFeatureType typeA, SimpleFeatureType typeB); static boolean equals(List attributesA, List attributesB); static boolean equalsExact(List attributesA, List attributesB); static boolean equals(
            AttributeDescriptor attributesA[], AttributeDescriptor attributesB[]); static boolean equalsExact(
            AttributeDescriptor attributesA[], AttributeDescriptor attributesB[]); static boolean equalsAncestors(SimpleFeatureType typeA, SimpleFeatureType typeB); static Set ancestors(SimpleFeatureType featureType); static boolean equals(AttributeDescriptor a, AttributeDescriptor b); static boolean equalsExact(AttributeDescriptor a, AttributeDescriptor b); static boolean equalsId(SimpleFeatureType typeA, SimpleFeatureType typeB); }
FeatureTypes { public static Filter createFieldOptions(Collection<?> options) { if (options == null || options.isEmpty()) { return null; } PropertyName thisProperty = FF.property("."); List<Filter> filters = options.stream() .map(o -> FF.equal(thisProperty, FF.literal(o), false)) .collect(Collectors.toList()); if (filters.size() == 1) { return filters.get(0); } else { return FF.or(filters); } }  static Filter createLengthRestriction(int length); static int getFieldLength(PropertyDescriptor descriptor); static List<?> getFieldOptions(PropertyDescriptor descriptor); static Filter createFieldOptions(Collection<?> options); static SimpleFeatureType transform(
            SimpleFeatureType schema, CoordinateReferenceSystem crs); static SimpleFeatureType transform(
            SimpleFeatureType schema, CoordinateReferenceSystem crs, boolean forceOnlyMissing); static SimpleFeature transform(
            SimpleFeature feature, SimpleFeatureType schema, MathTransform transform); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types,
            String name,
            URI ns,
            boolean isAbstract,
            SimpleFeatureType[] superTypes); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types,
            String name,
            URI ns,
            boolean isAbstract,
            SimpleFeatureType[] superTypes,
            AttributeDescriptor defaultGeometry); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types,
            String name,
            URI ns,
            boolean isAbstract,
            SimpleFeatureType[] superTypes,
            GeometryDescriptor defaultGeometry); static SimpleFeatureType newFeatureType(
            AttributeDescriptor[] types, String name, URI ns, boolean isAbstract); static SimpleFeatureType newFeatureType(AttributeDescriptor[] types, String name, URI ns); static SimpleFeatureType newFeatureType(AttributeDescriptor[] types, String name); static List<FeatureType> getAncestors(FeatureType featureType); static boolean matches(FeatureType featureType, Name name); static boolean isDecendedFrom(FeatureType featureType, URI namespace, String typeName); static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType); static boolean equals(SimpleFeatureType typeA, SimpleFeatureType typeB); static boolean equalsExact(SimpleFeatureType typeA, SimpleFeatureType typeB); static boolean equals(List attributesA, List attributesB); static boolean equalsExact(List attributesA, List attributesB); static boolean equals(
            AttributeDescriptor attributesA[], AttributeDescriptor attributesB[]); static boolean equalsExact(
            AttributeDescriptor attributesA[], AttributeDescriptor attributesB[]); static boolean equalsAncestors(SimpleFeatureType typeA, SimpleFeatureType typeB); static Set ancestors(SimpleFeatureType featureType); static boolean equals(AttributeDescriptor a, AttributeDescriptor b); static boolean equalsExact(AttributeDescriptor a, AttributeDescriptor b); static boolean equalsId(SimpleFeatureType typeA, SimpleFeatureType typeB); static final URI DEFAULT_NAMESPACE; static final SimpleFeatureType ABSTRACT_FEATURE_TYPE; static final NameImpl DEFAULT_TYPENAME; static final int ANY_LENGTH; static final SimpleFeatureType EMPTY; }