Skip to content

Commit 1a97236

Browse files
committed
Added abstract State class.
1 parent b261767 commit 1a97236

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

  • src/main/java/de/doubleslash/kata/designpattern/state
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package de.doubleslash.kata.designpattern.state;
2+
3+
public abstract class State {
4+
5+
protected String stateName;
6+
7+
public State turnOn() {
8+
return this;
9+
}
10+
11+
public State turnOff() {
12+
return this;
13+
}
14+
15+
public State wash() {
16+
return this;
17+
}
18+
19+
public State openDoor() {
20+
return this;
21+
}
22+
23+
public State closeDoor() {
24+
return this;
25+
}
26+
27+
public String getStateName() {
28+
return stateName;
29+
}
30+
31+
public String toString() {
32+
return getStateName();
33+
}
34+
35+
}

0 commit comments

Comments
 (0)