-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow explicit priority config in SlicesRuleDefinition #1436
allow explicit priority config in SlicesRuleDefinition #1436
Conversation
7f235cb
to
84d08d6
Compare
de37753
to
4583bb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
I'll push a tiny fixup commit to simplify the previously existing code. If you agree, we can squash it into yours and merge the PR.
@@ -67,12 +67,28 @@ public GivenSlices matching(String packageIdentifier) { | |||
return new GivenSlicesInternal(Priority.MEDIUM, Slices.matching(packageIdentifier)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could reduce a tiny bit of code duplication if this now delegated to the new method:
return new GivenSlicesInternal(Priority.MEDIUM, Slices.matching(packageIdentifier)); | |
return matching(packageIdentifier, Priority.MEDIUM); |
public GivenSlices matching(String packageIdentifier, Priority priority) { | ||
return new GivenSlicesInternal(priority, Slices.matching(packageIdentifier)); | ||
} | ||
|
||
/** | ||
* @see Slices#assignedFrom(SliceAssignment) | ||
*/ | ||
@PublicAPI(usage = ACCESS) | ||
public GivenSlices assignedFrom(SliceAssignment assignment) { | ||
return new GivenSlicesInternal(Priority.MEDIUM, Slices.assignedFrom(assignment)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could likewise delegate to the other new method:
return new GivenSlicesInternal(Priority.MEDIUM, Slices.assignedFrom(assignment)); | |
return assignedFrom(assignment, Priority.MEDIUM); |
Sweet! Thanks for tidying it up! |
Resolves: TNG#1434 Signed-off-by: riverhe <[email protected]>
334bf78
to
17a1160
Compare
Resolves: #1434