public static PrincipalKeyCredential fromValue(String value) throws InvalidCredentialValueException {
    if (isValidValue(value)) {
      value = value.substring(VALUE_PREFIX.length());
      try {
        return (value.isEmpty()) ? null : new Gson().fromJson(value, PrincipalKeyCredential.class);
      } catch (JsonSyntaxException e) {
        throw new InvalidCredentialValueException("The value does not represent a PrincipalKeyCredential", e);
      }
    } else {
      throw new InvalidCredentialValueException("The value does not represent a PrincipalKeyCredential");
    }
  }
Renders a new PrincipalKeyCredential from its value representation

@param value a String containing the value representation of this PrincipalKeyCredential
@return a new PrincipalKeyCredential or null if a new PrincipalKeyCredential cannot be created
ambari-server/src/main/java/org/apache/ambari/server/security/credential/PrincipalKeyCredential.java