Skip to content

Commit

Permalink
added missing extension name setter
Browse files Browse the repository at this point in the history
  • Loading branch information
pwinckles committed Feb 4, 2022
1 parent d3e2ab4 commit 580b30c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 580b30c

Please sign in to comment.