Skip to content

Commit

Permalink
Incr version & config utility methods for type conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvina committed Aug 29, 2018
1 parent 2b785ac commit c866ed2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.microsoft.dhalion</groupId>
<artifactId>dhalion</artifactId>
<version>0.2.4</version>
<version>0.2.5</version>
<packaging>jar</packaging>

<name>Dhalion</name>
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/microsoft/dhalion/conf/PolicyConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ public Object getConfig(String configName) {
return getConfig(configName, null);
}

public int intValue(String configKey, int defaultValue) {
int result = defaultValue;
if (getConfig(configKey) != null) {
result = (int) getConfig(configKey);
}
return result;
}

public String stringValue(String configKey, String defaultValue) {
String result = defaultValue;
if (getConfig(configKey) != null) {
result = (String) getConfig(configKey);
}
return result;
}

public Object getConfig(String configName, Object defaultValue) {
Object value = configs.get(configName);
if (value == null) {
Expand Down

0 comments on commit c866ed2

Please sign in to comment.