Skip to content

Commit

Permalink
feat: support the old names
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 27, 2024
1 parent d11f1d2 commit 6da9d03
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,21 @@ public enum PhysicalPropertyType {
* @return PhysicalPropertyType object
*/
public static PhysicalPropertyType byName(String name) {
// suport old names
name = name.toUpperCase();
if (name.equals("DENSITY")) {
name = "MASS_DENSITY";
}
if (name.equals("VISCOSITY")) {
name = "DYNAMIC_VISCOSITY";
}
if (name.equals("CONDUCTIVITY")) {
name = "THERMAL_CONDUCTIVITY";
}

// todo: consider replacing this function with built-in valueOf
for (PhysicalPropertyType pt : copyOfValues) {
if (pt.name().equals(name.toUpperCase())) {
if (pt.name().equals(name)) {
return pt;
}
}
Expand Down

0 comments on commit 6da9d03

Please sign in to comment.