You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2019/07/01 18:22:39 UTC
[sis] 01/01: Merge branch 'geoapi-3.1',
without changing the way to create CodeList since the new API is
not available in GeoAPI 3.0.1.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sis.git
commit c8bf60535d1d41870ef012bffaf6682ad468c41a
Merge: d2003d3 c468aad
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Jul 1 20:21:51 2019 +0200
Merge branch 'geoapi-3.1', without changing the way to create CodeList since the new API is not available in GeoAPI 3.0.1.
.../org/apache/sis/internal/util/CodeLists.java | 4 +
ide-project/NetBeans/nbproject/build-impl.xml~ | 2128 --------------------
2 files changed, 4 insertions(+), 2128 deletions(-)
diff --cc core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java
index 092a548,ee9d73d..02d119a
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/util/CodeLists.java
@@@ -48,31 -51,19 +48,35 @@@ public final class CodeLists implement
private final String codename;
/**
+ * {@code true} if {@link CodeList#valueOf} is allowed to create new code lists.
+ */
+ private final boolean canCreate;
+
+ /**
* Creates a new filter for the specified code name.
*/
- private CodeLists(final String codename) {
+ private CodeLists(final String codename, final boolean canCreate) {
this.codename = codename;
+ this.canCreate = canCreate;
+ }
+
+ /**
+ * Returns the name of the code to create, or {@code null} if no new code list shall be created.
++ *
++ * @return the name specified at construction time.
+ */
+ @Override
+ public String codename() {
+ return canCreate ? codename : null;
}
/**
* Returns {@code true} if the given code matches the name we are looking for.
+ *
+ * @param code the code list candidate.
*/
@Override
- public boolean test(final CodeList<?> code) {
+ public boolean accept(final CodeList<?> code) {
for (final String candidate : code.names()) {
if (accept(candidate, codename)) {
return true;