Skip to content

Commit

Permalink
Added option to overwrite ConditionalFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianKirmaier committed Nov 19, 2024
1 parent ef2df77 commit be69ce0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/
public final class Platform {

/** This is a placeholder for the actual implementation. */
public static java.util.function.Function<ConditionalFeature,Optional<Boolean>> overwriteIsSupported = (feature) -> Optional.empty();

// To prevent instantiation
private Platform() {
}
Expand Down Expand Up @@ -265,7 +268,7 @@ public static boolean isImplicitExit() {
* platform, otherwise false
*/
public static boolean isSupported(ConditionalFeature feature) {
return PlatformImpl.isSupported(feature);
return overwriteIsSupported.apply(feature).orElseGet(() -> PlatformImpl.isSupported(feature));
}

/**
Expand Down

0 comments on commit be69ce0

Please sign in to comment.