Improved: Simplify ‘entity.model.ModelField#EncryptMethod’ enum

(OFBIZ-10763)

The use of an overridden abstract method for isEncrypted is a bit overkill and 
could be replaced by a simple equality check

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850253 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2019-01-03 17:22:00 +00:00
parent 1b02bfa7aa
commit 25721714f1
@@ -40,23 +40,13 @@ public final class ModelField extends ModelChild {
public static final String module = ModelField.class.getName();
public enum EncryptMethod {
FALSE {
public boolean isEncrypted() {
return false;
}
},
TRUE {
public boolean isEncrypted() {
return true;
}
},
SALT {
public boolean isEncrypted() {
return true;
}
};
FALSE,
TRUE,
SALT;
public abstract boolean isEncrypted();
public boolean isEncrypted() {
return this != FALSE;
}
}
/**