title: Simplify if else conditions to reduce cognitive complexity in Java
body: <p>Is there a way to simplify this java function?</p>
  <p>Simplification is desired for maintainability of the code.</p>
  <pre><code>public void pushDocument(ESDocumentType esDocumentType, Object data, String documentId, long userId, long organizationId) {
      boolean proceed = false;
  
      if (esDocumentType.equals(ESDocumentType.XMLACTIVITY)) {
          proceed = Constants.ELASTIC_LOGGING_ENABLED &amp;&amp; Constants.ELASTIC_XMLACTIVITY_ENABLED || Constants.SQS_LOGGING_ENABLED;
      }
  
      else if (esDocumentType.equals(ESDocumentType.XMLREQRES)) {
          proceed = Constants.ELASTIC_LOGGING_ENABLED &amp;&amp; Constants.ELASTIC_XMLREQRES_ENABLED || Constants.SQS_LOGGING_ENABLED;
      }
  
      else if (esDocumentType.equals(ESDocumentType.ORDERHISTORY)) {
          proceed = Constants.ELASTIC_LOGGING_ENABLED &amp;&amp; Constants.ELASTIC_ORDERHISTORY_ENABLED || Constants.SQS_LOGGING_ENABLED;
      }
  
      else if (esDocumentType.equals(ESDocumentType.SINGIN)) {
          proceed = Constants.ELASTIC_LOGGING_ENABLED &amp;&amp; Constants.ELASTIC_SIGNIN_ENABLED || Constants.SQS_LOGGING_ENABLED;
      } else if (esDocumentType.equals(ESDocumentType.GOOGLESEARCH)) {
          proceed = Constants.ELASTIC_LOGGING_ENABLED &amp;&amp; Constants.ELASTIC_GOOGLESEARCH_ENABLED || Constants.SQS_LOGGING_ENABLED;
      }
  
      if (proceed) {
          LogThread logThread = new LogThread();
          logThread.pushDocument(esDocumentType, data, documentId, userId, organizationId);
      }
  }
  </code></pre>