forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of the new extension selection algorithm as proposed in …
…quarkusio#2737. Impact of the new selection algorithm on the guides. Most of it is purely cosmetic and allow using shorter names. Some tweaks are required to avoid ambiguity. Do not use dash in bean validation. Remove the swagger-ui short name. Swagger may mean something else.
- Loading branch information
1 parent
5d03b07
commit 1891574
Showing
18 changed files
with
451 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
devtools/common/src/main/java/io/quarkus/cli/commands/AddExtensionResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.cli.commands; | ||
|
||
public class AddExtensionResult { | ||
|
||
private final boolean updated; | ||
private final boolean succeeded; | ||
|
||
public AddExtensionResult(boolean updated, boolean succeeded) { | ||
this.updated = updated; | ||
this.succeeded = succeeded; | ||
} | ||
|
||
public boolean isUpdated() { | ||
return updated; | ||
} | ||
|
||
public boolean succeeded() { | ||
return succeeded; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
devtools/common/src/main/java/io/quarkus/cli/commands/SelectionResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.quarkus.cli.commands; | ||
|
||
import java.util.Set; | ||
|
||
import io.quarkus.dependencies.Extension; | ||
|
||
public class SelectionResult { | ||
|
||
private final Set<Extension> extensions; | ||
private final boolean matches; | ||
|
||
public SelectionResult(Set<Extension> extensions, boolean matches) { | ||
this.extensions = extensions; | ||
this.matches = matches; | ||
} | ||
|
||
public Set<Extension> getExtensions() { | ||
return extensions; | ||
} | ||
|
||
public boolean matches() { | ||
return matches; | ||
} | ||
|
||
public Extension getMatch() { | ||
if (matches) { | ||
if (extensions.isEmpty() || extensions.size() > 1) { | ||
throw new IllegalStateException("Invalid selection result"); | ||
} | ||
return extensions.iterator().next(); | ||
} | ||
return null; | ||
} | ||
} |
Oops, something went wrong.