+ // now that this RD type is not supported, we want to read the remain 6 bytes
+ // in order to get the byte index correct
+ for (int i = 0; i < 6; i++) {
+ routeDistiguisher.append("0x").append(Integer.toHexString(buffer.readByte() & 0xFF)).append(" ");
+ }
+ LOG.debug("Invalid Route Distinguisher: type={}, rawRouteDistinguisherValue={}", type, routeDistiguisher.toString());
+ throw new IllegalArgumentException("Invalid Route Distinguisher type " + type);
+ }
+ }
+
+ public static RouteDistinguisher parseRouteDistinguisher(final String str) {
+ return str == null ? null : RouteDistinguisherBuilder.getDefaultInstance(str);
+ }
+
+ public static RouteDistinguisher parseRouteDistinguisher(final Object obj) {
+ if (obj instanceof String) {
+ return RouteDistinguisherBuilder.getDefaultInstance((String) obj);
+ } else if (obj instanceof RouteDistinguisher) {
+ return (RouteDistinguisher) obj;
+ } else {
+ return null;