File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 21
21
* THE SOFTWARE.
22
22
*/
23
23
24
+ import org .slf4j .Logger ;
25
+ import org .slf4j .LoggerFactory ;
26
+
24
27
/**
25
28
* Created by Alexis on 28-Apr-17. With Marker interface idea is to make empty interface and extend
26
29
* it. Basically it is just to identify the special objects from normal objects. Like in case of
@@ -43,10 +46,23 @@ public class App {
43
46
* @param args command line args
44
47
*/
45
48
public static void main (String [] args ) {
49
+ final Logger logger = LoggerFactory .getLogger (App .class );
46
50
var guard = new Guard ();
47
51
var thief = new Thief ();
48
- guard .enter ();
49
- thief .doNothing ();
52
+
53
+ //noinspection ConstantConditions
54
+ if (guard instanceof Permission ) {
55
+ guard .enter ();
56
+ } else {
57
+ logger .info ("You have no permission to enter, please leave this area" );
58
+ }
59
+
60
+ //noinspection ConstantConditions
61
+ if (thief instanceof Permission ) {
62
+ thief .doNothing ();
63
+ } else {
64
+ thief .doNothing ();
65
+ }
50
66
}
51
67
}
52
68
You can’t perform that action at this time.
0 commit comments