Skip to content

Commit

Permalink
Implement Extensible.hasExtension
Browse files Browse the repository at this point in the history
Extensible.getExtension already has an implementation.

Allow hasExtension and getExtension to handle internal extensions, as
addExtension and removeExtension do. This means that they're not exactly
equivalent to getExtensions().hasKey and getExtensions().get.
  • Loading branch information
Azquelt committed Jan 21, 2025
1 parent cd0537b commit d8f9b2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ public void setExtensions(Map<String, Object> extensions) {
}
}

@Override
public boolean hasExtension(String name) {
return extensionNames.contains(name);
}

@Override
public Object getExtension(String name) {
if (extensionNames.contains(name)) {
return super.getProperty(name);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<version.eclipse.microprofile.config>3.0.3</version.eclipse.microprofile.config>
<version.io.smallrye.jandex>3.2.3</version.io.smallrye.jandex>
<version.io.smallrye.smallrye-config>3.10.2</version.io.smallrye.smallrye-config>
<version.eclipse.microprofile.openapi>4.0.2</version.eclipse.microprofile.openapi>
<version.eclipse.microprofile.openapi>4.1-SNAPSHOT</version.eclipse.microprofile.openapi>
<version.org.hamcrest>1.3</version.org.hamcrest>
<version.org.hamcrest.java-hamcrest>2.0.0.0</version.org.hamcrest.java-hamcrest>
<version.org.skyscreamer>1.5.3</version.org.skyscreamer>
Expand Down

0 comments on commit d8f9b2c

Please sign in to comment.