Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
fabapp2 committed Dec 13, 2023
1 parent 8b3061b commit 1866037
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,27 +161,30 @@ public List<Recipe> findRecipesByTag(String tag) {
*/
public Optional<Recipe> findRecipeByName(String name) {
List<Recipe> filteredRecipes = getFilteredRecipes(r -> r.getName().equals(name));
if(filteredRecipes.size() > 1) {
if (filteredRecipes.size() > 1) {
throw new IllegalStateException("Found more than one recipe with name '%s'".formatted(name));
} else if(filteredRecipes.isEmpty()) {
}
else if (filteredRecipes.isEmpty()) {
return Optional.empty();
} else {
}
else {
return Optional.of(filteredRecipes.get(0));
}
}

public Recipe getRecipeByName(String name) {
List<Recipe> filteredRecipes = getFilteredRecipes(r -> r.getName().equals(name));
if(filteredRecipes.size() > 1) {
if (filteredRecipes.size() > 1) {
throw new IllegalArgumentException("Found more than one recipe with name '%s'".formatted(name));
} else if(filteredRecipes.isEmpty()) {
}
else if (filteredRecipes.isEmpty()) {
throw new IllegalArgumentException("No recipe found with name '%s'".formatted(name));
} else {
}
else {
return filteredRecipes.get(0);
}
}


@NotNull
public static List<Recipe> getFilteredRecipes(Predicate<Recipe> filterPredicate) {
ResourceLoader resourceLoader = new ClasspathScanningLoader(new Properties(), new String[] {});
Expand All @@ -190,7 +193,7 @@ public static List<Recipe> getFilteredRecipes(Predicate<Recipe> filterPredicate)
return recipes;
}

// class AbstractRewriteMojoHelper extends AbstractRewriteMojo {
// class AbstractRewriteMojoHelper extends AbstractRewriteMojo {
//
// public AbstractRewriteMojoHelper(MavenProject mavenProject) {
// super.project = mavenProject;
Expand Down

0 comments on commit 1866037

Please sign in to comment.