MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / toString

Method toString

src/main/java/core/org/xbill/DNS/Message.java:588–613  ·  view source on GitHub ↗

Converts the Message to a String.

()

Source from the content-addressed store, hash-verified

586 * Converts the Message to a String.
587 */
588public String
589toString() {
590 StringBuffer sb = new StringBuffer();
591 OPTRecord opt = getOPT();
592 if (opt != null)
593 sb.append(header.toStringWithRcode(getRcode()) + "\n");
594 else
595 sb.append(header + "\n");
596 if (isSigned()) {
597 sb.append(";; TSIG ");
598 if (isVerified())
599 sb.append("ok");
600 else
601 sb.append("invalid");
602 sb.append('\n');
603 }
604 for (int i = 0; i < 4; i++) {
605 if (header.getOpcode() != Opcode.UPDATE)
606 sb.append(";; " + Section.longString(i) + ":\n");
607 else
608 sb.append(";; " + Section.updString(i) + ":\n");
609 sb.append(sectionToString(i) + "\n");
610 }
611 sb.append(";; Message size: " + numBytes() + " bytes");
612 return sb.toString();
613}
614
615/**
616 * Creates a copy of this Message. This is done by the Resolver before adding

Callers 1

sectionToStringMethod · 0.45

Calls 11

getOPTMethod · 0.95
getRcodeMethod · 0.95
isSignedMethod · 0.95
isVerifiedMethod · 0.95
longStringMethod · 0.95
updStringMethod · 0.95
sectionToStringMethod · 0.95
numBytesMethod · 0.95
toStringWithRcodeMethod · 0.80
getOpcodeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected