MCPcopy Create free account
hub / github.com/grpc/grpc-java / toString

Method toString

api/src/context/java/io/grpc/Deadline.java:201–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199 }
200
201 @Override
202 public String toString() {
203 long remainingNanos = timeRemaining(TimeUnit.NANOSECONDS);
204 long seconds = Math.abs(remainingNanos) / NANOS_PER_SECOND;
205 long nanos = Math.abs(remainingNanos) % NANOS_PER_SECOND;
206
207 StringBuilder buf = new StringBuilder();
208 if (remainingNanos < 0) {
209 buf.append('-');
210 }
211 buf.append(seconds);
212 if (nanos > 0) {
213 buf.append(String.format(Locale.US, ".%09d", nanos));
214 }
215 buf.append("s from now");
216 if (ticker != SYSTEM_TICKER) {
217 buf.append(" (ticker=" + ticker + ")");
218 }
219 return buf.toString();
220 }
221
222 /**
223 * {@inheritDoc}

Callers 4

toString_exactMethod · 0.95
toString_afterMethod · 0.95
toString_beforeMethod · 0.95

Calls 2

timeRemainingMethod · 0.95
appendMethod · 0.80

Tested by 4

toString_exactMethod · 0.76
toString_afterMethod · 0.76
toString_beforeMethod · 0.76