Skip to content

Commit

Permalink
Merge pull request #272 from giastfader/master
Browse files Browse the repository at this point in the history
callback management when an app setting value is overridden
  • Loading branch information
giastfader committed Mar 6, 2014
2 parents 855af9f + aea52cd commit c295231
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/com/baasbox/configuration/Application.java
Expand Up @@ -153,6 +153,7 @@ public void override(Object newValue) {
Object parsedValue=null;

if (Logger.isDebugEnabled()) Logger.debug("New setting value, key: " + this.key + ", type: "+ this.type + ", new value: " + newValue);
if (changeCallback != null) changeCallback.change(getValue(), newValue);
if (newValue != null)
if (type == Boolean.class)
parsedValue = Boolean.parseBoolean(newValue.toString());
Expand All @@ -167,6 +168,7 @@ else if (type == String.class)
this.overriddenValue=parsedValue;
this.overridden=true;
this.editable=false;

}

@Override
Expand Down
1 change: 1 addition & 0 deletions app/com/baasbox/configuration/ImagesConfiguration.java
Expand Up @@ -166,6 +166,7 @@ public void override(Object newValue) {
Object parsedValue=null;

if (Logger.isDebugEnabled()) Logger.debug("New setting value, key: " + this.key + ", type: "+ this.type + ", new value: " + newValue);
if (changeCallback != null) changeCallback.change(getValue(), newValue);
if (newValue != null)
if (type == Boolean.class)
parsedValue = Boolean.parseBoolean(newValue.toString());
Expand Down
1 change: 1 addition & 0 deletions app/com/baasbox/configuration/PasswordRecovery.java
Expand Up @@ -158,6 +158,7 @@ public void override(Object newValue) {
Object parsedValue=null;

if (Logger.isDebugEnabled()) Logger.debug("New setting value, key: " + this.key + ", type: "+ this.type + ", new value: " + newValue);
if (changeCallback != null) changeCallback.change(getValue(), newValue);
if (newValue != null)
if (type == Boolean.class)
parsedValue = Boolean.parseBoolean(newValue.toString());
Expand Down
1 change: 1 addition & 0 deletions app/com/baasbox/configuration/Push.java
Expand Up @@ -180,6 +180,7 @@ public void override(Object newValue) {
Object parsedValue=null;

if (Logger.isDebugEnabled()) Logger.debug("New setting value, key: " + this.key + ", type: "+ this.type + ", new value: " + newValue);
if (changeCallback != null) changeCallback.change(getValue(), newValue);
if (newValue != null)
if (type == Boolean.class)
parsedValue = Boolean.parseBoolean(newValue.toString());
Expand Down
Expand Up @@ -145,6 +145,7 @@ public void override(Object newValue) {
Object parsedValue=null;

if (Logger.isDebugEnabled()) Logger.debug("New setting value, key: " + this.key + ", type: "+ this.type + ", new value: " + newValue);
if (changeCallback != null) changeCallback.change(getValue(), newValue);
if (newValue != null)
if (type == Boolean.class)
parsedValue = Boolean.parseBoolean(newValue.toString());
Expand Down

0 comments on commit c295231

Please sign in to comment.