From f49713eab5d0a1d65707295deee5c39d8c084ff6 Mon Sep 17 00:00:00 2001 From: Peter Winckles Date: Fri, 4 Feb 2022 10:47:20 -0600 Subject: [PATCH] added missing extension name setter --- .../config/NTupleOmitPrefixStorageLayoutConfig.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ocfl-java-core/src/main/java/edu/wisc/library/ocfl/core/extension/storage/layout/config/NTupleOmitPrefixStorageLayoutConfig.java b/ocfl-java-core/src/main/java/edu/wisc/library/ocfl/core/extension/storage/layout/config/NTupleOmitPrefixStorageLayoutConfig.java index fe9c5c38..4957641c 100644 --- a/ocfl-java-core/src/main/java/edu/wisc/library/ocfl/core/extension/storage/layout/config/NTupleOmitPrefixStorageLayoutConfig.java +++ b/ocfl-java-core/src/main/java/edu/wisc/library/ocfl/core/extension/storage/layout/config/NTupleOmitPrefixStorageLayoutConfig.java @@ -26,6 +26,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonValue; +import edu.wisc.library.ocfl.api.exception.OcflExtensionException; import edu.wisc.library.ocfl.api.util.Enforce; import edu.wisc.library.ocfl.core.extension.OcflExtensionConfig; import edu.wisc.library.ocfl.core.extension.storage.layout.NTupleOmitPrefixStorageLayoutExtension; @@ -74,6 +75,13 @@ public String getExtensionName() { return NTupleOmitPrefixStorageLayoutExtension.EXTENSION_NAME; } + public void setExtensionName(String extensionName) { + if (!Objects.equals(getExtensionName(), extensionName)) { + throw new OcflExtensionException(String.format("The extension name for %s must be %s; found %s.", + getClass().getSimpleName(), getExtensionName(), extensionName)); + } + } + @JsonIgnore @Override public boolean hasParameters() {