Tunnel: Require passing a state to the constructor

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland
2018-01-06 05:18:34 -06:00
parent 1c2239ae91
commit df7d18fb5d
2 changed files with 8 additions and 6 deletions
@@ -31,15 +31,16 @@ public class Tunnel extends BaseObservable implements Keyed<String> {
private final ConfigStore configStore;
private final String name;
private Config config;
private State state = State.UNKNOWN;
private State state;
private Statistics statistics;
Tunnel(@NonNull final Backend backend, @NonNull final ConfigStore configStore,
@NonNull final String name, @Nullable final Config config) {
@NonNull final String name, @Nullable final Config config, @NonNull final State state) {
this.backend = backend;
this.configStore = configStore;
this.name = name;
this.config = config;
this.state = state;
}
public static boolean isNameValid(final CharSequence name) {