diff options
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java')
-rw-r--r-- | src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java index d6f14ea..6405924 100644 --- a/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java +++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java @@ -37,6 +37,31 @@ public class ASPathAttribute implements PathAttribute { public static class Segment { byte type; List<Integer> asns = new ArrayList<>(); + + public String toString() { + StringBuffer buf = new StringBuffer(); + + buf.append("("); + for(Integer asn : asns) { + if (buf.length() > 1) + buf.append(" "); + buf.append(asn); + } + buf.append(")"); + return buf.toString(); + } } + public String toString() { + StringBuffer buf = new StringBuffer(); + + buf.append("["); + for(Segment segment : segments) { + if (buf.length() > 1) + buf.append(", "); + buf.append(segment); + } + buf.append("]"); + return buf.toString(); + } } |