#567 fix version and javadoc

This commit is contained in:
Aleksandar Dudukovic
2017-05-23 01:38:02 +02:00
parent 1abd96a9c8
commit f2e35ec03d
9 changed files with 34 additions and 32 deletions

View File

@ -1,3 +1,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by Alexis on 28-Apr-17.
* With Marker interface idea is to make empty interface and extend it.
@ -25,13 +28,14 @@ public class App {
*/
public static void main(String[] args) {
final Logger logger = LoggerFactory.getLogger(App.class);
Guard guard = new Guard();
Thief thief = new Thief();
if (guard instanceof Permission) {
guard.enter();
} else {
System.out.println("You have no permission to enter, please leave this area");
logger.info("You have no permission to enter, please leave this area");
}
if (thief instanceof Permission) {

View File

@ -1,10 +1,15 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by Alexis on 29-Apr-17.
* Class defining Guard
*/
public class Guard implements Permission {
protected static void enter() {
System.out.println("You can enter");
}
private static final Logger LOGGER = LoggerFactory.getLogger(Guard.class);
protected static void enter() {
LOGGER.info("You can enter");
}
}

View File

@ -1,5 +1,4 @@
/**
* Created by Alexis on 29-Apr-17.
* Interface without any methods
* Marker interface is based on that assumption
*/

View File

@ -1,12 +1,18 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by Alexis on 02-May-17.
* Class defining Thief
*/
public class Thief {
private static final Logger LOGGER = LoggerFactory.getLogger(Thief.class);
protected static void steal() {
System.out.println("Steal valuable items");
LOGGER.info("Steal valuable items");
}
protected static void doNothing() {
System.out.println("Pretend nothing happened and just leave");
LOGGER.info("Pretend nothing happened and just leave");
}
}