We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Say, I have the following methods.
class Some { static Stream<Arguments> getNameAndAgeArgumentsStream() { return Stream.of( Arguments.of( Named.of("Whatever", "John"), // <<<<<<<<<<<<<<<<< 1 ); } } class Other { static Stream<Arguments> getNameAndAgeArgumentsStream() { return Stream.of( Arguments.of( "Jane", // <<<<<<<<<<<<<<<<<<<<<<< 1 ); } }
Now I want to use those two methods in other class.
class Another { static Stream<Arguments> getPrefixedNameAndAgeArguemntsStream() { return Stream.concat( Some.getNameAndAgeArgumentsStream(), Other.getNameAndAgeArgumentsStream() ) .map(a -> { var arguments = a.get(); var name = arguments[0] instanceof Named ? ((Named<String>) arguments[0]).getPayload() : arguments[0]; return Arguments.of( "prefix" + name, arguments[1] ); }); } }
I had to use a method looks like this.
public static <T> T payload(final Object argument) { Objects.requireNonNull(argument, "argument is null"); if (argument instanceof Named<?>) { return payload(((Named<?>) argument).getPayload()); } return (T) argument; }
Arguments
getPayloads()[Ljava.lang.Object
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Say, I have the following methods.
Now I want to use those two methods in other class.
I had to use a method looks like this.
Deliverables
Arguments
, say,getPayloads()[Ljava.lang.Object
The text was updated successfully, but these errors were encountered: