Skip to content

Instantly share code, notes, and snippets.

@michaeldejong
Last active October 24, 2019 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeldejong/3aa25c4d5210f8f4818eefc414235dee to your computer and use it in GitHub Desktop.
Save michaeldejong/3aa25c4d5210f8f4818eefc414235dee to your computer and use it in GitHub Desktop.
@RequiredArgsConstructor(onConstructor = @__(@javax.inject.Inject))
public class Users {
private final Client client;
public GetUserRequest getUser(long userId) {
return new GetUserRequest(client, userId);
}
}
@Data
public class GetUserRequest {
private final Client client;
private final long userId;
public Single<User> execute() {
return client.get(Service.REST_API, "/users/" + userId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment