}
private static String bundleStateToText(int state) {
- switch (state) {
- case Bundle.INSTALLED:
- return "Installed";
- case Bundle.RESOLVED:
- return "Resolved";
- case Bundle.STARTING:
- return "Starting";
- case Bundle.ACTIVE:
- return "Active";
- case Bundle.STOPPING:
- return "Stopping";
- case Bundle.UNINSTALLED:
- return "Uninstalled";
- default:
- return state + "???";
- }
+ return switch (state) {
+ case Bundle.INSTALLED -> "Installed";
+ case Bundle.RESOLVED -> "Resolved";
+ case Bundle.STARTING -> "Starting";
+ case Bundle.ACTIVE -> "Active";
+ case Bundle.STOPPING -> "Stopping";
+ case Bundle.UNINSTALLED -> "Uninstalled";
+ default -> state + "???";
+ };
}
@Override
@Override
public URLStreamHandler createURLStreamHandler(String protocol) {
- switch (protocol) {
- case MVN_URI_PREFIX:
- return new org.ops4j.pax.url.mvn.Handler();
- case WRAP_URI_PREFIX:
- return new org.ops4j.pax.url.wrap.Handler();
- case FEATURE_URI_PREFIX:
- return new FeatureURLHandler();
- case BLUEPRINT_URI_PREFIX:
- return new BlueprintURLHandler();
- default:
- return null;
- }
+ return switch (protocol) {
+ case MVN_URI_PREFIX -> new org.ops4j.pax.url.mvn.Handler();
+ case WRAP_URI_PREFIX -> new org.ops4j.pax.url.wrap.Handler();
+ case FEATURE_URI_PREFIX -> new FeatureURLHandler();
+ case BLUEPRINT_URI_PREFIX -> new BlueprintURLHandler();
+ default -> null;
+ };
}
}