MtasSolrMtasResult.java.html 24.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>MtasSolrMtasResult.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">MTAS</a> &gt; <a href="index.source.html" class="el_package">mtas.solr.handler.component.util</a> &gt; <span class="el_source">MtasSolrMtasResult.java</span></div><h1>MtasSolrMtasResult.java</h1><pre class="source lang-java linenums">package mtas.solr.handler.component.util;

import java.io.IOException;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;

import mtas.codec.util.CodecComponent.SubComponentDistance;
import mtas.codec.util.DataCollector;
import mtas.codec.util.collector.MtasDataCollector;
import mtas.codec.util.collector.MtasDataCollectorResult;
import mtas.codec.util.collector.MtasDataItem;
import mtas.codec.util.distance.Distance;

/**
 * The Class MtasSolrMtasResult.
 */
public class MtasSolrMtasResult implements Serializable {

  /** The Constant serialVersionUID. */
  private static final long serialVersionUID = 1L;

  /** The data type. */
  public String dataType;

  /** The stats type. */
  public String statsType;

  /** The distances. */
  public List&lt;SubComponentDistance&gt; distances;

  /** The sort type. */
  public String sortType;

  /** The sort direction. */
  public String sortDirection;

  /** The start. */
  public Integer start;

  /** The number. */
  public Integer number;

  /** The data collector. */
<span class="fc" id="L53">  public MtasDataCollector&lt;?, ?&gt; dataCollector = null;</span>

  /** The function data. */
  public Map&lt;MtasDataCollector&lt;?, ?&gt;, HashMap&lt;String, MtasSolrMtasResult&gt;&gt; functionData;

  /** The sub data type. */
  private String[] subDataType;

  /** The sub stats type. */
  private String[] subStatsType;

  /** The sub stats items. */
  private SortedSet&lt;String&gt;[] subStatsItems;

  /** The sub distances. */
  private List&lt;SubComponentDistance&gt;[] subDistances;

  /** The sub sort type. */
  private String[] subSortType;

  /** The sub sort direction. */
  private String[] subSortDirection;

  /** The sub start. */
  private Integer[] subStart;

  /** The sub number. */
  private Integer[] subNumber;

  /**
   * Instantiates a new mtas solr mtas result.
   *
   * @param dataCollector the data collector
   * @param dataType the data type
   * @param statsType the stats type
   * @param statsItems the stats items
   * @param distances the distances
   * @param sortType the sort type
   * @param sortDirection the sort direction
   * @param start the start
   * @param number the number
   * @param functionData the function data
   */
  @SuppressWarnings(&quot;unchecked&quot;)
  public MtasSolrMtasResult(MtasDataCollector&lt;?, ?&gt; dataCollector,
      String[] dataType, String[] statsType, SortedSet&lt;String&gt;[] statsItems,
      List&lt;SubComponentDistance&gt;[] distances, String[] sortType,
      String[] sortDirection, Integer[] start, Integer[] number,
<span class="fc" id="L101">      Map&lt;MtasDataCollector&lt;?, ?&gt;, HashMap&lt;String, MtasSolrMtasResult&gt;&gt; functionData) {</span>
<span class="fc" id="L102">    this.dataCollector = dataCollector;</span>
<span class="fc" id="L103">    this.functionData = functionData;</span>
<span class="pc bpc" id="L104" title="1 of 2 branches missed.">    this.dataType = (dataType == null) ? null : dataType[0];</span>
<span class="pc bpc" id="L105" title="1 of 2 branches missed.">    this.statsType = (statsType == null) ? null : statsType[0];</span>
<span class="pc bpc" id="L106" title="1 of 2 branches missed.">    this.distances = (distances == null) ? null : distances[0];</span>
<span class="pc bpc" id="L107" title="1 of 2 branches missed.">    this.sortType = (sortType == null) ? null : sortType[0];</span>
<span class="pc bpc" id="L108" title="1 of 2 branches missed.">    this.sortDirection = (sortDirection == null) ? null : sortDirection[0];</span>
<span class="pc bpc" id="L109" title="1 of 2 branches missed.">    this.start = (start == null) ? null : start[0];</span>
<span class="pc bpc" id="L110" title="1 of 2 branches missed.">    this.number = (number == null) ? null : number[0];</span>
<span class="fc" id="L111">    this.subStart = null;</span>
<span class="fc" id="L112">    this.subNumber = null;</span>
<span class="pc bpc" id="L113" title="2 of 4 branches missed.">    if ((dataType != null) &amp;&amp; (dataType.length &gt; 1)) {</span>
<span class="nc" id="L114">      subDataType = new String[dataType.length - 1];</span>
<span class="nc" id="L115">      subStatsType = new String[dataType.length - 1];</span>
<span class="nc" id="L116">      subStatsItems = new TreeSet[dataType.length - 1];</span>
<span class="nc" id="L117">      subDistances = new List[dataType.length - 1];</span>
<span class="nc" id="L118">      subSortType = new String[dataType.length - 1];</span>
<span class="nc" id="L119">      subSortDirection = new String[dataType.length - 1];</span>
<span class="nc" id="L120">      System.arraycopy(dataType, 1, subDataType, 0, dataType.length - 1);</span>
<span class="nc" id="L121">      System.arraycopy(statsType, 1, subStatsType, 0, dataType.length - 1);</span>
<span class="nc" id="L122">      System.arraycopy(statsItems, 1, subStatsItems, 0, dataType.length - 1);</span>
<span class="nc" id="L123">      System.arraycopy(distances, 1, subDistances, 0, dataType.length - 1);</span>
<span class="nc" id="L124">      System.arraycopy(sortType, 1, subSortType, 0, dataType.length - 1);</span>
<span class="nc" id="L125">      System.arraycopy(sortDirection, 1, subSortDirection, 0,</span>
          dataType.length - 1);
    } else {
<span class="fc" id="L128">      subDataType = null;</span>
<span class="fc" id="L129">      subStatsType = null;</span>
<span class="fc" id="L130">      subStatsItems = null;</span>
<span class="fc" id="L131">      subDistances = null;</span>
<span class="fc" id="L132">      subSortType = null;</span>
<span class="fc" id="L133">      subSortDirection = null;</span>
    }
<span class="fc" id="L135">  }</span>

  /**
   * Instantiates a new mtas solr mtas result.
   *
   * @param dataCollector the data collector
   * @param dataType the data type
   * @param statsType the stats type
   * @param statsItems the stats items
   * @param distance the distance
   * @param functionData the function data
   */
  @SuppressWarnings(&quot;unchecked&quot;)
  public MtasSolrMtasResult(MtasDataCollector&lt;?, ?&gt; dataCollector,
      String dataType, String statsType, SortedSet&lt;String&gt; statsItems,
      List&lt;SubComponentDistance&gt; distance,
      Map&lt;MtasDataCollector&lt;?, ?&gt;, HashMap&lt;String, MtasSolrMtasResult&gt;&gt; functionData) {
<span class="fc" id="L152">    this(dataCollector, new String[] { dataType }, new String[] { statsType },</span>
        new SortedSet[] { statsItems }, new List[] { distance },
<span class="fc" id="L154">        new String[] { null }, new String[] { null }, new Integer[] { 0 },</span>
<span class="fc" id="L155">        new Integer[] { 1 }, functionData);</span>
<span class="fc" id="L156">  }</span>

  /**
   * Merge.
   *
   * @param newItem the new item
   * @throws IOException Signals that an I/O exception has occurred.
   */
  void merge(MtasSolrMtasResult newItem) throws IOException {
<span class="fc" id="L165">    HashMap&lt;MtasDataCollector&lt;?, ?&gt;, MtasDataCollector&lt;?, ?&gt;&gt; map = new HashMap&lt;&gt;();</span>
<span class="fc bfc" id="L166" title="All 2 branches covered.">    if (newItem.dataCollector.withTotal()) {</span>
<span class="fc" id="L167">      dataCollector.setWithTotal();</span>
    }
<span class="fc" id="L169">    dataCollector.merge(newItem.dataCollector, map, true);</span>
<span class="fc bfc" id="L170" title="All 2 branches covered.">    if (newItem.functionData != null) {</span>
<span class="pc bpc" id="L171" title="1 of 2 branches missed.">      if (functionData == null) {</span>
<span class="nc" id="L172">        functionData = new HashMap&lt;&gt;();</span>
      }
<span class="fc bfc" id="L174" title="All 2 branches covered.">      for (MtasDataCollector&lt;?, ?&gt; keyCollector : newItem.functionData</span>
<span class="fc" id="L175">          .keySet()) {</span>
<span class="pc bpc" id="L176" title="1 of 2 branches missed.">        if (map.containsKey(keyCollector)) {</span>
          // compute mapped key
<span class="fc" id="L178">          MtasDataCollector&lt;?, ?&gt; newKeyCollector = keyCollector;</span>
<span class="fc bfc" id="L179" title="All 2 branches covered.">          while (map.containsKey(newKeyCollector)) {</span>
<span class="fc" id="L180">            newKeyCollector = map.get(keyCollector);</span>
          }
<span class="pc bpc" id="L182" title="1 of 2 branches missed.">          if (functionData.containsKey(newKeyCollector)) {</span>
<span class="fc" id="L183">            HashMap&lt;String, MtasSolrMtasResult&gt; tmpList = functionData</span>
<span class="fc" id="L184">                .get(newKeyCollector);</span>
<span class="pc bpc" id="L185" title="1 of 2 branches missed.">            for (String functionKey : newItem.functionData.get(keyCollector)</span>
<span class="fc" id="L186">                .keySet()) {</span>
<span class="nc bnc" id="L187" title="All 2 branches missed.">              if (tmpList.containsKey(functionKey)) {</span>
<span class="nc" id="L188">                tmpList.get(functionKey).merge(</span>
<span class="nc" id="L189">                    newItem.functionData.get(keyCollector).get(functionKey));</span>
              } else {
<span class="nc" id="L191">                tmpList.put(functionKey,</span>
<span class="nc" id="L192">                    newItem.functionData.get(keyCollector).get(functionKey));</span>
              }
<span class="nc" id="L194">            }</span>
<span class="fc" id="L195">          } else {</span>
<span class="nc" id="L196">            functionData.put(newKeyCollector,</span>
<span class="nc" id="L197">                newItem.functionData.get(keyCollector));</span>
          }
        }
<span class="fc" id="L200">      }</span>
    }
<span class="fc" id="L202">  }</span>

  /**
   * Gets the data.
   *
   * @param showDebugInfo the show debug info
   * @return the data
   * @throws IOException Signals that an I/O exception has occurred.
   */
  NamedList&lt;Object&gt; getData(boolean showDebugInfo) throws IOException {
<span class="fc" id="L212">    if (dataCollector.getCollectorType()</span>
<span class="pc bpc" id="L213" title="1 of 2 branches missed.">        .equals(DataCollector.COLLECTOR_TYPE_DATA)) {</span>
<span class="fc" id="L214">      NamedList&lt;Object&gt; mtasResponse = new SimpleOrderedMap&lt;&gt;();</span>
      // functions
<span class="fc" id="L216">      Map&lt;String, NamedList&lt;Object&gt;&gt; functionList = new HashMap&lt;&gt;();</span>
<span class="pc bpc" id="L217" title="1 of 4 branches missed.">      if (functionData != null &amp;&amp; functionData.containsKey(dataCollector)) {</span>
<span class="fc" id="L218">        HashMap&lt;String, MtasSolrMtasResult&gt; functionDataItem = functionData</span>
<span class="fc" id="L219">            .get(dataCollector);</span>
<span class="pc bpc" id="L220" title="1 of 2 branches missed.">        for (Entry&lt;String, MtasSolrMtasResult&gt; entry : functionDataItem</span>
<span class="fc" id="L221">            .entrySet()) {</span>
<span class="nc" id="L222">          MtasSolrMtasResult functionResult = entry.getValue();</span>
<span class="nc" id="L223">          if (functionResult.dataCollector.getCollectorType()</span>
<span class="nc bnc" id="L224" title="All 2 branches missed.">              .equals(DataCollector.COLLECTOR_TYPE_DATA)) {</span>
<span class="nc" id="L225">            NamedList&lt;Object&gt; functionData = functionResult</span>
<span class="nc" id="L226">                .getData(showDebugInfo);</span>
<span class="nc" id="L227">            functionList.put(entry.getKey(), functionData);</span>
<span class="nc" id="L228">          } else {</span>
<span class="nc" id="L229">            throw new IOException(&quot;unexpected function collectorType &quot;</span>
<span class="nc" id="L230">                + functionResult.dataCollector.getCollectorType());</span>
          }
<span class="nc" id="L232">        }</span>
      }
      // main result
<span class="fc" id="L235">      MtasDataItem&lt;?, ?&gt; dataItem = dataCollector.getResult().getData();</span>
<span class="fc bfc" id="L236" title="All 2 branches covered.">      if (dataItem != null) {</span>
<span class="fc" id="L237">        mtasResponse.addAll(dataItem.rewrite(showDebugInfo));</span>
<span class="pc bpc" id="L238" title="1 of 2 branches missed.">        if (functionList.size() &gt; 0) {</span>
<span class="nc" id="L239">          mtasResponse.add(&quot;functions&quot;, functionList);</span>
        }
<span class="pc bpc" id="L241" title="3 of 4 branches missed.">        if ((subDataType != null) &amp;&amp; (dataItem.getSub() != null)) {</span>
<span class="nc" id="L242">          MtasSolrMtasResult css = new MtasSolrMtasResult(dataItem.getSub(),</span>
              subDataType, subStatsType, subStatsItems, subDistances,
              subSortType, subSortDirection, subStart, subNumber, functionData);
<span class="nc" id="L245">          if (dataItem.getSub().getCollectorType()</span>
<span class="nc bnc" id="L246" title="All 2 branches missed.">              .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="nc" id="L247">            mtasResponse.add(dataItem.getSub().getCollectorType(),</span>
<span class="nc" id="L248">                css.getNamedList(showDebugInfo));</span>
<span class="nc" id="L249">          } else if (dataItem.getSub().getCollectorType()</span>
<span class="nc bnc" id="L250" title="All 2 branches missed.">              .equals(DataCollector.COLLECTOR_TYPE_DATA)) {</span>
<span class="nc" id="L251">            mtasResponse.add(dataItem.getSub().getCollectorType(),</span>
<span class="nc" id="L252">                css.getData(showDebugInfo));</span>
          }
        }
      }
<span class="fc" id="L256">      return mtasResponse;</span>
    } else {
<span class="nc" id="L258">      throw new IOException(</span>
          &quot;only allowed for &quot; + DataCollector.COLLECTOR_TYPE_DATA);
    }
  }

  /**
   * Gets the key list.
   *
   * @return the key list
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public Set&lt;String&gt; getKeyList() throws IOException {
<span class="fc" id="L270">    if (dataCollector.getCollectorType()</span>
<span class="pc bpc" id="L271" title="1 of 2 branches missed.">        .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="fc" id="L272">      return dataCollector.getResult().getComparatorList().keySet();</span>
    } else {
<span class="nc" id="L274">      throw new IOException(</span>
          &quot;only allowed for &quot; + DataCollector.COLLECTOR_TYPE_LIST);
    }
  }

  /**
   * Gets the full key list.
   *
   * @return the full key list
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public Set&lt;String&gt; getFullKeyList() throws IOException {
<span class="nc" id="L286">    if (dataCollector.getCollectorType()</span>
<span class="nc bnc" id="L287" title="All 2 branches missed.">        .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="nc" id="L288">      return dataCollector.getKeyList();</span>
    } else {
<span class="nc" id="L290">      throw new IOException(</span>
          &quot;only allowed for &quot; + DataCollector.COLLECTOR_TYPE_LIST);
    }
  }

  /**
   * Gets the named list.
   *
   * @param showDebugInfo the show debug info
   * @return the named list
   * @throws IOException Signals that an I/O exception has occurred.
   */
  NamedList&lt;Object&gt; getNamedList(boolean showDebugInfo) throws IOException {
<span class="fc" id="L303">    if (dataCollector.getCollectorType()</span>
<span class="pc bpc" id="L304" title="1 of 2 branches missed.">        .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="fc" id="L305">      SimpleOrderedMap&lt;Object&gt; mtasResponseList = new SimpleOrderedMap&lt;&gt;();</span>
      // functions
<span class="fc" id="L307">      Map&lt;String, SimpleOrderedMap&lt;Object&gt;&gt; functionList = new HashMap&lt;&gt;();</span>
<span class="pc bpc" id="L308" title="1 of 4 branches missed.">      if (functionData != null &amp;&amp; functionData.containsKey(dataCollector)) {</span>
<span class="fc" id="L309">        HashMap&lt;String, MtasSolrMtasResult&gt; functionDataItem = functionData</span>
<span class="fc" id="L310">            .get(dataCollector);</span>
<span class="pc bpc" id="L311" title="1 of 2 branches missed.">        for (Entry&lt;String, MtasSolrMtasResult&gt; entry : functionDataItem</span>
<span class="fc" id="L312">            .entrySet()) {</span>
<span class="nc" id="L313">          MtasSolrMtasResult functionResult = entry.getValue();</span>
<span class="nc" id="L314">          if (functionResult.dataCollector.getCollectorType()</span>
<span class="nc bnc" id="L315" title="All 2 branches missed.">              .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="nc" id="L316">            NamedList&lt;Object&gt; functionNamedList = functionResult</span>
<span class="nc" id="L317">                .getNamedList(showDebugInfo);</span>
<span class="nc bnc" id="L318" title="All 2 branches missed.">            for (int i = 0; i &lt; functionNamedList.size(); i++) {</span>
<span class="nc bnc" id="L319" title="All 2 branches missed.">              if (functionList.containsKey(functionNamedList.getName(i))) {</span>
<span class="nc" id="L320">                SimpleOrderedMap&lt;Object&gt; tmpMap = functionList</span>
<span class="nc" id="L321">                    .get(functionNamedList.getName(i));</span>
<span class="nc" id="L322">                tmpMap.add(entry.getKey(), functionNamedList.getVal(i));</span>
<span class="nc" id="L323">              } else {</span>
<span class="nc" id="L324">                SimpleOrderedMap&lt;Object&gt; tmpMap = new SimpleOrderedMap&lt;&gt;();</span>
<span class="nc" id="L325">                tmpMap.add(entry.getKey(), functionNamedList.getVal(i));</span>
<span class="nc" id="L326">                functionList.put(functionNamedList.getName(i), tmpMap);</span>
              }
            }
<span class="nc" id="L329">          } else {</span>
<span class="nc" id="L330">            throw new IOException(&quot;unexpected function collectorType &quot;</span>
<span class="nc" id="L331">                + functionResult.dataCollector.getCollectorType());</span>
          }
<span class="nc" id="L333">        }</span>
      }
      // main result
<span class="fc" id="L336">      Map&lt;String, ?&gt; dataList = dataCollector.getResult().getList();</span>
<span class="fc bfc" id="L337" title="All 2 branches covered.">      for (Entry&lt;String, ?&gt; entry : dataList.entrySet()) {</span>
<span class="fc" id="L338">        SimpleOrderedMap&lt;Object&gt; mtasResponseListItem = new SimpleOrderedMap&lt;&gt;();</span>
<span class="fc" id="L339">        MtasDataItem&lt;?, ?&gt; dataItem = (MtasDataItem&lt;?, ?&gt;) entry.getValue();</span>
<span class="pc bpc" id="L340" title="1 of 4 branches missed.">        if (this.distances != null &amp;&amp; !this.distances.isEmpty()) {</span>
<span class="nc" id="L341">          SimpleOrderedMap&lt;Object&gt; mtasResponseListItemDistance = new SimpleOrderedMap&lt;&gt;();</span>
<span class="nc bnc" id="L342" title="All 2 branches missed.">          for (SubComponentDistance item : this.distances) {</span>
<span class="nc" id="L343">            mtasResponseListItemDistance.add(item.key,</span>
<span class="nc" id="L344">                item.getDistance().compute(entry.getKey()));</span>
<span class="nc" id="L345">          }</span>
<span class="nc" id="L346">          mtasResponseListItem.add(Distance.NAME, mtasResponseListItemDistance);</span>
        }
<span class="fc" id="L348">        mtasResponseListItem.addAll(dataItem.rewrite(showDebugInfo));</span>
<span class="pc bpc" id="L349" title="1 of 2 branches missed.">        if (functionList.containsKey(entry.getKey())) {</span>
<span class="nc" id="L350">          mtasResponseListItem.add(&quot;functions&quot;,</span>
<span class="nc" id="L351">              functionList.get(entry.getKey()));</span>
        }
<span class="pc bpc" id="L353" title="3 of 4 branches missed.">        if ((subDataType != null) &amp;&amp; (dataItem.getSub() != null)) {</span>
<span class="nc" id="L354">          MtasSolrMtasResult css = new MtasSolrMtasResult(dataItem.getSub(),</span>
              subDataType, subStatsType, subStatsItems, subDistances,
              subSortType, subSortDirection, subStart, subNumber, functionData);
<span class="nc" id="L357">          if (dataItem.getSub().getCollectorType()</span>
<span class="nc bnc" id="L358" title="All 2 branches missed.">              .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="nc bnc" id="L359" title="All 2 branches missed.">            if (css.dataCollector.withTotal()) {</span>
<span class="nc" id="L360">              mtasResponseListItem.add(</span>
                  DataCollector.COLLECTOR_TYPE_LIST + &quot;Total&quot;,
<span class="nc" id="L362">                  css.dataCollector.getSize());</span>
            }
<span class="nc" id="L364">            mtasResponseListItem.add(DataCollector.COLLECTOR_TYPE_LIST,</span>
<span class="nc" id="L365">                css.getNamedList(showDebugInfo));</span>
<span class="nc" id="L366">          } else if (dataItem.getSub().getCollectorType()</span>
<span class="nc bnc" id="L367" title="All 2 branches missed.">              .equals(DataCollector.COLLECTOR_TYPE_DATA)) {</span>
<span class="nc" id="L368">            mtasResponseListItem.add(DataCollector.COLLECTOR_TYPE_DATA,</span>
<span class="nc" id="L369">                css.getData(showDebugInfo));</span>
          }
        }
<span class="fc" id="L372">        mtasResponseList.add(entry.getKey(), mtasResponseListItem);</span>
<span class="fc" id="L373">      }</span>
<span class="fc" id="L374">      return mtasResponseList;</span>
    } else {
<span class="nc" id="L376">      throw new IOException(</span>
          &quot;only allowed for &quot; + DataCollector.COLLECTOR_TYPE_LIST);
    }
  }

  /*
   * (non-Javadoc)
   * 
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
<span class="nc" id="L388">    if (dataCollector.getCollectorType()</span>
<span class="nc bnc" id="L389" title="All 2 branches missed.">        .equals(DataCollector.COLLECTOR_TYPE_DATA)) {</span>
<span class="nc" id="L390">      return this.getClass().getSimpleName() + &quot;(data-&quot; + hashCode() + &quot;)&quot;;</span>
    }
<span class="nc" id="L392">    if (dataCollector.getCollectorType()</span>
<span class="nc bnc" id="L393" title="All 2 branches missed.">        .equals(DataCollector.COLLECTOR_TYPE_LIST)) {</span>
<span class="nc" id="L394">      return this.getClass().getSimpleName() + &quot;(list(&quot;</span>
<span class="nc" id="L395">          + dataCollector.getSize() + &quot;)-&quot; + hashCode() + &quot;)&quot;;</span>
    } else {
<span class="nc" id="L397">      return this.getClass().getSimpleName() + &quot;: unknown&quot;;</span>
    }
  }

  /**
   * Gets the result.
   *
   * @return the result
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public MtasDataCollectorResult getResult() throws IOException {
<span class="fc" id="L408">    return dataCollector.getResult();</span>
  }

}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html>