code: public static Asn parse(String text) {
          try {
              String asnString = Validate.notNull(text, "AS Number must not be null").trim().toUpperCase();
              if (asnString.startsWith("AS")) {
                  asnString = asnString.substring(2);
              }
              long low;
              long high = 0L;
              int indexOfDot = asnString.indexOf('.');
              if (indexOfDot != -1) {
                  low = Validate.checkRange(Long.valueOf(asnString.substring(indexOfDot + 1)), ASN_MIN_VALUE, ASN_16_BIT_MAX_VALUE);
                  high = Validate.checkRange(Long.valueOf(asnString.substring(0, indexOfDot)), ASN_MIN_VALUE, ASN_16_BIT_MAX_VALUE);
              } else {
                  low = Long.valueOf(asnString);
              }
              return new Asn((high << SIXTEEN) | low);
          } catch (Exception ex) {
              throw new IllegalArgumentException("Invalid AS number: '" + text + "'. Details: " + ex.getMessage(), ex);
          }
      }
docs: Parses a <tt>String</tt> into an {@link Asn}. The representation formats that are supported are
  asplain, asdot+ and asdot as defined in RFC5396.
  
  @param text a string of an AS number e.g. "AS123", "AS0.123", "123" e.t.c.
  @return a new {@link Asn}
  @throws IllegalArgumentException if the string cannot be parsed
  @see <a href="http://tools.ietf.org/html/rfc5396">RFC5396 -
  Textual Representation of Autonomous System (AS) Numbers</a>