Returns a human readable string representation of the object.
()
| 568 | |
| 569 | /** Returns a human readable string representation of the object. */ |
| 570 | public String toString() { |
| 571 | // The argument passed to StringBuilder is a pretty good estimate of the |
| 572 | // length of the final string based on the row key and number of elements. |
| 573 | final String metric = metricName(); |
| 574 | final StringBuilder buf = new StringBuilder(80 + metric.length() |
| 575 | + row.length * 4 + size * 16); |
| 576 | final long base_time = baseTime(); |
| 577 | buf.append("IncomingDataPoints(") |
| 578 | .append(row == null ? "<null>" : Arrays.toString(row)) |
| 579 | .append(" (metric=").append(metric).append("), base_time=") |
| 580 | .append(base_time).append(" (") |
| 581 | .append(base_time > 0 ? new Date(base_time * 1000) : "no date") |
| 582 | .append("), ["); |
| 583 | for (short i = 0; i < size; i++) { |
| 584 | buf.append('+').append(delta(qualifiers[i])); |
| 585 | if (isInteger(i)) { |
| 586 | buf.append(":long(").append(longValue(i)); |
| 587 | } else { |
| 588 | buf.append(":float(").append(doubleValue(i)); |
| 589 | } |
| 590 | buf.append(')'); |
| 591 | if (i != size - 1) { |
| 592 | buf.append(", "); |
| 593 | } |
| 594 | } |
| 595 | buf.append("])"); |
| 596 | return buf.toString(); |
| 597 | } |
| 598 | |
| 599 | @Override |
| 600 | public Deferred<Object> persist() { |
no test coverage detected