package com.maxmind.geoip2;

import java.lang.*;
import java.util.*;
import java.io.*;
import org.json.*;

public class TraitsRecord
{
  private String ipAddress;
  private Integer autonomousSystemNumber;
  private String autonomousSystemOrganization;
  private String domain;
  private String isp;
  private String organization;
  private String userType;
  private boolean anonymousProxy;
  private boolean transparentProxy;
  private boolean usMilitary;
  
  public TraitsRecord(JSONObject json) throws JSONException {
    ipAddress = json.getString("ip_address");
    if (json.has("autonomous_system_number")) {
      autonomousSystemNumber = new Integer(json.getInt("autonomous_system_number"));
    }
    autonomousSystemOrganization = json.optString("autonomous_system_organization",null);
    domain = json.optString("domain",null);
    isp = json.optString("isp",null);
    organization = json.optString("organization",null);
    userType = json.optString("user_type",null);
    anonymousProxy = json.optBoolean("is_anonymous_proxy");
    transparentProxy = json.optBoolean("is_transparent_proxy");
    usMilitary = json.optBoolean("is_us_military");

  }
  public String getIpAddress() {
    return ipAddress;
  }
  public Integer getAutonomousSystemNumber() {
    return autonomousSystemNumber;
  }
  public String getAutonomousSystemOrganization() {
    return autonomousSystemOrganization;
  }
  public String getDomain() {
    return domain;
  }
  public String getIsp() {
    return isp;
  }
  public String getOrganization() {
    return organization;
  }
  public String getUserType() {
    return userType;
  }
  public boolean isAnonymousProxy() {
    return anonymousProxy;
  }
  public boolean isTransparentProxy() {
    return transparentProxy;
  }
  public boolean isUsMilitary() {
    return usMilitary;
  }

}



@@ -388,77 +388,11 @@
 xy;%0A
-  private boolean transparentProxy;%0A  private boolean usMilitary;%0A
   %0A
+
   pu
@@ -974,124 +974,8 @@
 y%22);
-%0A    transparentProxy = json.optBoolean(%22is_transparent_proxy%22);%0A    usMilitary = json.optBoolean(%22is_us_military%22);
 %0A%0A  
@@ -1470,32 +1470,32 @@
 nymousProxy() %7B%0A
+
     return anony
@@ -1512,142 +1512,8 @@
 %0A  %7D
-%0A  public boolean isTransparentProxy() %7B%0A    return transparentProxy;%0A  %7D%0A  public boolean isUsMilitary() %7B%0A    return usMilitary;%0A  %7D
 %0A%0A%7D%0A

remove is_transparent_proxy and is_us_military