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;
  
  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"));
    }
    if (json.has("autonomous_system_organization")) {
      autonomousSystemOrganization = new Integer(json.getInt("autonomous_system_organization"));
    }
    domain = json.optString("domain",null);
    isp = json.optString("isp",null);
    organization = json.optString("organization",null);
    userType = json.optString("user_type",null);
  }
  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;
  }
}



@@ -354,11 +354,111 @@
 pe;%0A
+  private boolean anonymousProxy;%0A  private boolean transparentProxy;%0A  private boolean usMilitary;%0A
   %0A
-
   pu
@@ -704,64 +704,8 @@
   %7D%0A
-    if (json.has(%22autonomous_system_organization%22)) %7B%0A  
     
@@ -735,39 +735,30 @@
 ation = 
-new Integer(json.getInt
+json.optString
 (%22autono
@@ -782,25 +782,23 @@
 ization%22
-));%0A    %7D
+,null);
 %0A    dom
@@ -977,16 +977,193 @@
 ,null);%0A
+    anonymousProxy = json.optBoolean(%22is_anonymous_proxy%22);%0A    transparentProxy = json.optBoolean(%22is_transparent_proxy%22);%0A    usMilitary = json.optBoolean(%22is_us_military%22);%0A%0A
   %7D%0A  pu
@@ -1618,16 +1618,220 @@
 erType;%0A
-
   %7D%0A
+  public boolean isAnonymousProxy() %7B%0A    return anonymousProxy;%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%0A%0A

add is_anonymous_proxy