Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LTE-01 authored and LTE-01 committed Oct 20, 2017
2 parents 8de76af + 3589e79 commit e9adde1
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,33 @@ of the ConfigManager. ;-)
## The Test class
```java
import com.laurencetrippen.jpg.ConfigManager;
import com.laurencetrippen.jpg.exception.ConfigFileAlreadyExistException;
import com.laurencetrippen.jpg.exception.ConfigFileNotDefinedException;
import com.laurencetrippen.jpg.exception.ConfigFileNotExistException;
import com.laurencetrippen.jpg.exception.PathNotExistException;

public class Tester {

public static void main(String[] args) {
public static void main(String[] args) throws ConfigFileNotDefinedException, PathNotExistException {
ConfigManager<Configuration> cm = new ConfigManager<>(Configuration.class);
cm.generateConfig();

Configuration cfg = cm.load();
try {
cm.generateConfig();
} catch (ConfigFileAlreadyExistException e) {
e.printStackTrace();
}

cfg.setPort(880);
cfg.setIp("255.255.255.255");
cfg.setTimeout(20.2f);
cfg.setDelay(20.4054);
cfg.setLazyLoading(true);
Configuration cfg = null;
try {
cfg = cm.load();
cfg.setPort(880);
cfg.setIp("255.255.255.255");
cfg.setTimeout(20.2f);
cfg.setDelay(20.4054);
cfg.setLazyLoading(true);
} catch (ConfigFileNotExistException e) {
e.printStackTrace();
}

cm.save(cfg);
}
Expand Down

0 comments on commit e9adde1

Please sign in to comment.