-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from PalladioSimulator/remove_redundant_interf…
…aces Remove redundant interfaces
- Loading branch information
Showing
19 changed files
with
330 additions
and
146 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
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
21 changes: 12 additions & 9 deletions
21
...r.extraction/src/org/palladiosimulator/retriever/extraction/commonalities/HTTPMethod.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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
package org.palladiosimulator.retriever.extraction.commonalities; | ||
|
||
import java.util.Collection; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public enum HTTPMethod { | ||
GET, POST, PUT, DELETE, PATCH; | ||
GET, POST, PUT, DELETE, PATCH, | ||
/** | ||
* Special value signaling all HTTPMethods are provided/required. | ||
*/ | ||
WILDCARD; | ||
|
||
public static boolean areAllPresent(Collection<HTTPMethod> httpMethods) { | ||
return httpMethods.containsAll(all()); | ||
} | ||
|
||
public static Set<HTTPMethod> all() { | ||
return Set.of(values()); | ||
} | ||
if (httpMethods.contains(HTTPMethod.WILDCARD)) { | ||
return true; | ||
} | ||
|
||
public static Set<HTTPMethod> any() { | ||
return Set.of(); | ||
Set<HTTPMethod> normalValues = new HashSet<>(Set.of(values())); | ||
normalValues.remove(WILDCARD); | ||
return httpMethods.containsAll(normalValues); | ||
} | ||
} |
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
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
Oops, something went wrong.