Small refactoring
This commit is contained in:
parent
58051dc0f2
commit
1bc3b03b8d
1 changed files with 2 additions and 3 deletions
|
|
@ -208,8 +208,6 @@ public class Configurator<T> {
|
||||||
* {@link #applyConfiguration()} needs to be called
|
* {@link #applyConfiguration()} needs to be called
|
||||||
*/
|
*/
|
||||||
public void setValue(String v){
|
public void setValue(String v){
|
||||||
if(obj == null)
|
|
||||||
return;
|
|
||||||
switch(type){
|
switch(type){
|
||||||
case STRING:
|
case STRING:
|
||||||
value = v; break;
|
value = v; break;
|
||||||
|
|
@ -221,7 +219,8 @@ public class Configurator<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void apply() throws IllegalAccessException {
|
protected void apply() throws IllegalAccessException {
|
||||||
field.set(obj, value);
|
if(obj != null)
|
||||||
|
field.set(obj, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue