code: public static String credentialReferencePartAsStringIfDefined(ModelNode credentialReferenceValue, String name) throws OperationFailedException {
          assert credentialReferenceValue.isDefined() : credentialReferenceValue;
          ModelNode result = credentialReferenceValue.get(name);
          if (result.isDefined()) {
              return result.asString();
          }
          return null;
      }
docs: Utility method to return part of {@link ObjectTypeAttributeDefinition} for credential reference attribute.
  
  {@see CredentialReference#getAttributeDefinition}
  @param credentialReferenceValue value of credential reference attribute
  @param name name of part to return (supported names: {@link #STORE} {@link #ALIAS} {@link #TYPE}
  {@link #CLEAR_TEXT}
  @return value of part as {@link String}
  @throws OperationFailedException when something goes wrong