class Pcaps {

  public static DataLinkType dataLinkNameToVal(String name) throws PcapNativeException {
    if (name == null) {
      StringBuilder sb = new StringBuilder();
      sb.append("name: ").append(name);
      throw new NullPointerException(sb.toString());
    }

    int rc = NativeMappings.pcap_datalink_name_to_val(name);
    if (rc < 0) {
      throw new PcapNativeException(
          "Failed to convert the data link name to the value: " + name, rc);
    }
    return DataLinkType.getInstance(rc);
  }

  private  Pcaps();

}