private boolean isValidConditionSettings(Cluster cluster, String configType, String targetPropertyKey,
      String ifKey, String ifType, String ifValue, PropertyKeyState ifKeyState){

    //Operation is always valid if there are no conditions specified
    boolean isValid = false;

    boolean ifKeyIsNotBlank = StringUtils.isNotBlank(ifKey);
    boolean ifTypeIsNotBlank = StringUtils.isNotBlank(ifType);
    boolean ifValueIsNotNull = (null != ifValue);
    boolean ifKeyStateIsValid = (PropertyKeyState.PRESENT == ifKeyState || PropertyKeyState.ABSENT == ifKeyState);

    if(ifKeyIsNotBlank && ifTypeIsNotBlank && (ifValueIsNotNull || ifKeyStateIsValid)) {
      // allow if the condition has ifKey, ifType and either ifValue or ifKeyState
      isValid = true;
    } else if (!ifKeyIsNotBlank && !ifTypeIsNotBlank && !ifValueIsNotNull &&  !ifKeyStateIsValid) {
      //no condition, allow
      isValid = true;
    }

    return isValid;
  }
Sanity check for invalid attribute settings on if-key, if-value, if-key-state, if-site
Regardless whether it's set, transfer, or replace, the condition attributes are the same
So the same logic can be used to determine if the operation is allowed or not.
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/ConfigureTask.java