com.sunlightlabs.entities
Class Legislator

java.lang.Object
  extended by com.sunlightlabs.entities.JSONEntity
      extended by com.sunlightlabs.entities.Legislator

public class Legislator
extends JSONEntity

represents a state legislator com.sunlightlabs.entities.Legislator steve Jul 22, 2009


Field Summary
static Legislator[] EMPTY_ARRAY
           
static java.lang.String[] KNOWN_PROPERTIES
           
static java.lang.String name
           
static java.lang.Class<Legislator> THIS_CLASS
           
 
Constructor Summary
Legislator(JSONObject data)
          constructor
Legislator(java.util.Map data)
          constructor
 
Method Summary
static Legislator[] allLegislators(com.sunlightlabs.api.ApiCall call)
          return all Legislators in the database
static Legislator[] allLegislators(com.sunlightlabs.api.ApiCall call, java.util.Map<java.lang.String,java.lang.String> params)
           
 java.lang.String getEntityName()
          JSON Tag for this
 java.lang.String[] getKnownProperties()
          unofficial list of properties
static Legislator getLegislator(com.sunlightlabs.api.ApiCall call, java.lang.String name)
           
static Legislator getLegislatorById(com.sunlightlabs.api.ApiCall call, java.util.Map<java.lang.String,java.lang.String> params)
           
static Legislator getLegislatorById(com.sunlightlabs.api.ApiCall call, java.lang.String id)
          Look up a Legislator by bioguide_id
static Legislator[] getLegislatorsForZipCode(com.sunlightlabs.api.ApiCall call, java.lang.String zipcode)
           
 java.lang.String getName()
           
static java.lang.String getPluralEntityName()
           
 
Methods inherited from class com.sunlightlabs.entities.JSONEntity
equivalent, getAllKeys, getArrayItems, getArrayStringItems, getContainedJSONObject, getJSONObject, getJSONObjects, getJSONStrings, getNameValuePairs, getProperties, getProperty, show, show, showProperties, showProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THIS_CLASS

public static java.lang.Class<Legislator> THIS_CLASS

EMPTY_ARRAY

public static Legislator[] EMPTY_ARRAY

KNOWN_PROPERTIES

public static final java.lang.String[] KNOWN_PROPERTIES

name

public static final java.lang.String name
See Also:
Constant Field Values
Constructor Detail

Legislator

public Legislator(JSONObject data)
constructor

Parameters:
data - non-nulljson object with properties

Legislator

public Legislator(java.util.Map data)
constructor

Parameters:
data - non-null map with properties
Method Detail

getPluralEntityName

public static java.lang.String getPluralEntityName()

allLegislators

public static Legislator[] allLegislators(com.sunlightlabs.api.ApiCall call)
return all Legislators in the database

Parameters:
call - non-null caller
Returns:
non-null array of Legislators

allLegislators

public static Legislator[] allLegislators(com.sunlightlabs.api.ApiCall call,
                                          java.util.Map<java.lang.String,java.lang.String> params)
Parameters:
call - non-null caller
params - non-null mapo of search properties
Returns:
non-null array of Legislators

getLegislatorsForZipCode

public static Legislator[] getLegislatorsForZipCode(com.sunlightlabs.api.ApiCall call,
                                                    java.lang.String zipcode)
Parameters:
call - non-null caller
zipcode -
Returns:

getLegislatorById

public static Legislator getLegislatorById(com.sunlightlabs.api.ApiCall call,
                                           java.lang.String id)
Look up a Legislator by bioguide_id

Parameters:
call - non-null caller
id - non-null bioguide_id
Returns:
possibly null Legislator

getLegislatorById

public static Legislator getLegislatorById(com.sunlightlabs.api.ApiCall call,
                                           java.util.Map<java.lang.String,java.lang.String> params)
Parameters:
call - non-null caller
params -
Returns:

getLegislator

public static Legislator getLegislator(com.sunlightlabs.api.ApiCall call,
                                       java.lang.String name)

getEntityName

public java.lang.String getEntityName()
JSON Tag for this

Specified by:
getEntityName in class JSONEntity
Returns:
non-null String

getKnownProperties

public java.lang.String[] getKnownProperties()
unofficial list of properties

Specified by:
getKnownProperties in class JSONEntity

getName

public java.lang.String getName()