class Prefix implements Comparable<Prefix>, Serializable {

  @Nonnull
  @JsonCreator
  public static Prefix parse(@Nullable String text) {
    checkArgument(text != null, "Invalid IPv4 prefix %s", text);
    String[] parts = text.split("/");
    checkArgument(parts.length == 2, "Invalid prefix string: \"%s\"", text);
    Ip ip = Ip.parse(parts[0]);
    int prefixLength;
    try {
      prefixLength = Integer.parseInt(parts[1]);
    } catch (NumberFormatException e) {
      throw new IllegalArgumentException("Invalid prefix length: \"" + parts[1] + "\"", e);
    }
    return create(ip, prefixLength);
  }

  private  Prefix(Ip ip, int prefixLength);

}