public static UpdateConfigurationPolicy translate(String stringValue) {
    if (stringValue != null) {
      stringValue = stringValue.trim().toUpperCase();

      if (!stringValue.isEmpty()) {
        try {
          return valueOf(stringValue.replace('-', '_'));
        } catch (IllegalArgumentException e) {
          // ignore this and return null later...
        }
      }
    }

    return null;
  }
Safely translates a {@link String} value to an {@link UpdateConfigurationPolicy}.
<p>
The input value will be trimmed and converted to all uppercase characters.  If "-"'s are used
instead of "_"'s, they will be converted.

@param stringValue the String to translate
@return The translated {@link UpdateConfigurationPolicy} value; or <code>null</code> if a translation cannot be made
ambari-server/src/main/java/org/apache/ambari/server/controller/UpdateConfigurationPolicy.java