Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Builder
- @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
- public final class Repo {
- private final Function<String, RevCommit> commitStrategy;
- public Option<RevCommit> commit(String commitMessage) {
- return Option(commitStrategy)
- .onEmpty(() -> log.info("no CommitStrategy defined"))
- .map($ -> $.apply(commitMessage));
- }
- public static Repo Repo(){
- return Repo.builder()
- .commitStrategy(SOME_STATIC_FUNCTION) // or provided via factory args
- .build();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement