-
Notifications
You must be signed in to change notification settings - Fork 95
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
implement Match module functions #116
Conversation
01a14f0
to
65585c0
Compare
*/ | ||
public static String join(List<String> list, String delimiter) { | ||
if (list.isEmpty()) { | ||
return ""; |
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.
42!
This is not nice.
Especially, if you're fun of lambdas. 😉
public static String join(List<String> list, String delimiter) {
StringBuilder out = new StringBuilder();
if (list != null && !list.isEmpty()) {
out.append(list.get(0));
list.subList(1, list.size()).stream().forEach((item) -> {
out.append(delimiter).append(item);
});
}
return out.toString();
}
65585c0
to
a7c9b10
Compare
/** | ||
* salt.modules.match | ||
*/ | ||
public class Match { |
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.
BTW, @renner suggests to have at least have a documentation for the whole class with the URL link to it. Maybe Johannes will write more here.
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.
I will open a separate issue to track the documentation of the modules where we also can discuss what to do. In any case adding documentation should be done in a separate PR that covers all modules.
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 opening the issue, @lucidd! From my perspective there is no need to add javadoc for the Match
module class within this patch, especially I wouldn't want to copy it from the salt documentation for the reasons mentioned in #117. For now let's just do it as the other module classes we already have, i.e. keep it as it is.
a7c9b10
to
3dcd4a4
Compare
@@ -63,5 +63,4 @@ public void testStreamToString() { | |||
new ByteArrayInputStream(TEST_STRING.getBytes())); | |||
assertEquals("Result doesn't match test string", TEST_STRING, result); | |||
} | |||
|
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.
While this change makes sense it does not actually seem to belong to this patch.
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.
Oops seems like a left over from a previous version i will remove it. (or rather add it back 😄 )
4113290
to
158b8e6
Compare
158b8e6
to
36f8e93
Compare
implement Match module functions
This implements some of the functions in the match Module