Skip to content
Permalink
Browse files

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
  • Loading branch information
JacquesLeRoux committed Jan 3, 2019
1 parent 1b02bfa commit 25721714f168d7330410d5d6ec83f5a172fd29f6
Showing with 6 additions and 16 deletions.
  1. +6 −16 framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelField.java
@@ -40,23 +40,13 @@
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;
}
}

/**

0 comments on commit 2572171

Please sign in to comment.
You can’t perform that action at this time.