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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user