| 1 | package com.github.dakusui.actionunit.actions.cmd; | |
| 2 | ||
| 3 | import com.github.dakusui.actionunit.actions.cmd.unix.SshOptions; | |
| 4 | ||
| 5 | import java.util.function.Function; | |
| 6 | ||
| 7 | import static java.util.Objects.requireNonNull; | |
| 8 | ||
| 9 | public interface CommanderFactory { | |
| 10 | CommanderConfig config(); | |
| 11 | ||
| 12 | abstract class Base implements CommanderFactory { | |
| 13 | final CommanderConfig commanderConfig; | |
| 14 | ||
| 15 | ||
| 16 | protected Base(CommanderConfig commanderConfig) { | |
| 17 | this.commanderConfig = requireNonNull(commanderConfig); | |
| 18 | } | |
| 19 | ||
| 20 | @Override | |
| 21 | public CommanderConfig config() { | |
| 22 |
1
1. config : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Base::config → KILLED |
return this.commanderConfig; |
| 23 | } | |
| 24 | } | |
| 25 | ||
| 26 | abstract class Builder<B extends Builder<B, C>, C extends CommanderFactory> { | |
| 27 | CommanderConfig config; | |
| 28 | Function<String, SshOptions> sshOptionsResolver; | |
| 29 | ||
| 30 | protected Builder() { | |
| 31 |
1
1. lambda$new$0 : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::lambda$new$0 → NO_COVERAGE |
this.sshOptionsResolver(h -> new SshOptions.Builder().build()) |
| 32 | .config(new CommanderConfig.Builder().build()); | |
| 33 | } | |
| 34 | ||
| 35 | @SuppressWarnings("unchecked") | |
| 36 | public B config(CommanderConfig config) { | |
| 37 | this.config = requireNonNull(config); | |
| 38 |
1
1. config : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::config → KILLED |
return (B) this; |
| 39 | } | |
| 40 | ||
| 41 | @SuppressWarnings("unchecked") | |
| 42 | public B sshOptionsResolver(Function<String, SshOptions> sshOptionsResolver) { | |
| 43 | this.sshOptionsResolver = requireNonNull(sshOptionsResolver); | |
| 44 |
1
1. sshOptionsResolver : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::sshOptionsResolver → KILLED |
return (B) this; |
| 45 | } | |
| 46 | ||
| 47 | public C build() { | |
| 48 |
1
1. build : replaced return value with null for com/github/dakusui/actionunit/actions/cmd/CommanderFactory$Builder::build → KILLED |
return createCommanderFactory(config, sshOptionsResolver); |
| 49 | } | |
| 50 | ||
| 51 | protected abstract C createCommanderFactory(CommanderConfig config, Function<String, SshOptions> sshOptions); | |
| 52 | } | |
| 53 | } | |
Mutations | ||
| 22 |
1.1 |
|
| 31 |
1.1 |
|
| 38 |
1.1 |
|
| 44 |
1.1 |
|
| 48 |
1.1 |