opengeospatial / geoapi

GeoAPI provides a set of interfaces in programming languages (currently Java and Python) for geospatial applications. The GeoAPI interfaces closely follow OGC specifications, adaptated to match the expectations of programmers.
http://www.geoapi.org
Apache License 2.0
118 stars 37 forks source link

Remove CodeList.valueOf(Filter) #31

Closed desruisseaux closed 5 years ago

desruisseaux commented 6 years ago

Deprecate, and later remove, the CodeList.valueOf(Filter) method and the associated CodeList.Filter Java interface. Since Java 8, this interface duplicates the new java.util.function package; CodeList.Filter could be replaced by BiPredicate<CodeList, String> where the String argument is the name of the requested code list.

However we may not need to replace with BiPredicate neither. In practice, we only request for a code list matching any of the names returned by CodeList.names() ignoring case. A lenient CodeList.valueOf(String name, boolean allowCreate) method may be sufficient. If we really want a replacement with all CodeList.valueOf(Filter) functionalities, a CodeList.valueOf(Class, BiPredicate, boolean) method in the root class only (not in any sub-classes) may be sufficient.