// Path: src/main/java/org/continuousassurance/swamp/session/MyResponse.java
// public class MyResponse {
//     public JSONObject json;
//     public JSONArray jsonArray;
//     public List<Cookie> cookies;
//     public OutputStream outputStream;
// 
//    public boolean hasJSON(){return json != null;}
// 
//     public int getHttpResponseCode() {
//         return httpResponseCode;
//     }
// 
//     public void setHttpResponseCode(int httpResponseCode) {
//         this.httpResponseCode = httpResponseCode;
//     }
// 
//     int httpResponseCode = 0;
// 
//     public MyResponse(OutputStream outputStream, List<Cookie> cookies) {
//         this.outputStream = outputStream;
//         this.cookies = cookies;
//     }
// 
//     boolean streamable = false;
//     /**
//      * Returns if this response should be interpreted as a stream rather than a JSON object.
//      * @return
//      */
//     public boolean isStreamable(){return streamable;}
//     public void setStreamable(boolean streamable){this.streamable = streamable;}
//      public OutputStream getOutputStream(){return outputStream;}
// 
//     public MyResponse(JSON json, List<Cookie> cookies) {
//         this.cookies = cookies;
//         if(json == null) return;
//         if (json.isArray()) {
//             jsonArray = (JSONArray) json;
//         }
//         if (json instanceof JSONObject) {
//             this.json = (JSONObject) json;
//         }
//     }
// 
//     public void setOutputStream(OutputStream outputStream) {
//         this.outputStream = outputStream;
//     }
// }
// 
// Path: src/main/java/org/continuousassurance/swamp/session/util/ConversionMapImpl.java
// public class ConversionMapImpl extends HashMap<String, Object> implements ConversionMap<String, Object> {
//     public static final boolean BOOLEAN_DEFAULT = false;
//     public static final long LONG_DEFAULT = 0L;
// 
// 
//     @Override
//     public Date getDate(java.lang.String key) {
//         return (Date) get(key);
//     }
// 
//     @Override
//     public boolean getBoolean(java.lang.String key) {
//         Object x = get(key);
//         if(x == null) return BOOLEAN_DEFAULT;
//         return (boolean) x;
//     }
// 
//     @Override
//     public long getLong(java.lang.String key) {
//         if(get(key) == null) return LONG_DEFAULT;
//         return (long) get(key);
//     }
// 
//     @Override
//     public java.lang.String getString(String key) {
//         Object x = get(key);
//         if (x == null) return null;
//         return x.toString();
//     }
// 
// 
//     @Override
//     public Identifier getIdentifier(String key) {
//         return (Identifier) get(key);
//     }
// 
// 
//     @Override
//     public URI getURI(java.lang.String key) {
//         Object x = get(key);
//         if (x == null) return null;
//         return URI.create(x.toString());
//     }
// 
//     @Override
//     public byte[] getBytes(java.lang.String key) {
//         Object x = get(key);
//         if (x.getClass().isArray()) {
//             // try to return it...
//             return (byte[]) x;
//         }
//         return null;
//     }
// }


import org.continuousassurance.swamp.api.User;
import org.continuousassurance.swamp.session.MyResponse;
import org.continuousassurance.swamp.session.Session;
import org.continuousassurance.swamp.session.util.ConversionMapImpl;
import net.sf.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
package org.continuousassurance.swamp.session.handlers;



/**
 * <p>Created by Jeff Gaynor<br>
 * on 11/20/14 at  10:08 AM
 */
public class UserHandler<T extends User> extends AbstractHandler<T> {

    public static final String USER_UID_KEY = "user_uid";
    public static final String FIRST_NAME_KEY = "first_name";
    public static final String LAST_NAME_KEY = "last_name";
    public static final String PREFERRED_NAME_KEY = "preferred_name";
    public static final String USERNAME_KEY = "username";
    public static final String EMAIL_KEY = "email";
    public static final String ADDRESS_KEY = "address";
    public static final String PHONE_KEY = "phone";
    public static final String AFFILIATION_KEY = "affiliation";
    public static final String EMAIL_VERIFIED_KEY = "email_verified_flag";
// Path: src/main/java/org/continuousassurance/swamp/session/MyResponse.java
// public class MyResponse {
//     public JSONObject json;
//     public JSONArray jsonArray;
//     public List<Cookie> cookies;
//     public OutputStream outputStream;
// 
//    public boolean hasJSON(){return json != null;}
// 
//     public int getHttpResponseCode() {
//         return httpResponseCode;
//     }
// 
//     public void setHttpResponseCode(int httpResponseCode) {
//         this.httpResponseCode = httpResponseCode;
//     }
// 
//     int httpResponseCode = 0;
// 
//     public MyResponse(OutputStream outputStream, List<Cookie> cookies) {
//         this.outputStream = outputStream;
//         this.cookies = cookies;
//     }
// 
//     boolean streamable = false;
//     /**
//      * Returns if this response should be interpreted as a stream rather than a JSON object.
//      * @return
//      */
//     public boolean isStreamable(){return streamable;}
//     public void setStreamable(boolean streamable){this.streamable = streamable;}
//      public OutputStream getOutputStream(){return outputStream;}
// 
//     public MyResponse(JSON json, List<Cookie> cookies) {
//         this.cookies = cookies;
//         if(json == null) return;
//         if (json.isArray()) {
//             jsonArray = (JSONArray) json;
//         }
//         if (json instanceof JSONObject) {
//             this.json = (JSONObject) json;
//         }
//     }
// 
//     public void setOutputStream(OutputStream outputStream) {
//         this.outputStream = outputStream;
//     }
// }
// 
// Path: src/main/java/org/continuousassurance/swamp/session/util/ConversionMapImpl.java
// public class ConversionMapImpl extends HashMap<String, Object> implements ConversionMap<String, Object> {
//     public static final boolean BOOLEAN_DEFAULT = false;
//     public static final long LONG_DEFAULT = 0L;
// 
// 
//     @Override
//     public Date getDate(java.lang.String key) {
//         return (Date) get(key);
//     }
// 
//     @Override
//     public boolean getBoolean(java.lang.String key) {
//         Object x = get(key);
//         if(x == null) return BOOLEAN_DEFAULT;
//         return (boolean) x;
//     }
// 
//     @Override
//     public long getLong(java.lang.String key) {
//         if(get(key) == null) return LONG_DEFAULT;
//         return (long) get(key);
//     }
// 
//     @Override
//     public java.lang.String getString(String key) {
//         Object x = get(key);
//         if (x == null) return null;
//         return x.toString();
//     }
// 
// 
//     @Override
//     public Identifier getIdentifier(String key) {
//         return (Identifier) get(key);
//     }
// 
// 
//     @Override
//     public URI getURI(java.lang.String key) {
//         Object x = get(key);
//         if (x == null) return null;
//         return URI.create(x.toString());
//     }
// 
//     @Override
//     public byte[] getBytes(java.lang.String key) {
//         Object x = get(key);
//         if (x.getClass().isArray()) {
//             // try to return it...
//             return (byte[]) x;
//         }
//         return null;
//     }
// }


// Path: src/main/java/org/continuousassurance/swamp/session/handlers/UserHandler.java
import org.continuousassurance.swamp.api.User;
import org.continuousassurance.swamp.session.MyResponse;
import org.continuousassurance.swamp.session.Session;
import org.continuousassurance.swamp.session.util.ConversionMapImpl;
import net.sf.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

package org.continuousassurance.swamp.session.handlers;



/**
 * <p>Created by Jeff Gaynor<br>
 * on 11/20/14 at  10:08 AM
 */
public class UserHandler<T extends User> extends AbstractHandler<T> {

    public static final String USER_UID_KEY = "user_uid";
    public static final String FIRST_NAME_KEY = "first_name";
    public static final String LAST_NAME_KEY = "last_name";
    public static final String PREFERRED_NAME_KEY = "preferred_name";
    public static final String USERNAME_KEY = "username";
    public static final String EMAIL_KEY = "email";
    public static final String ADDRESS_KEY = "address";
    public static final String PHONE_KEY = "phone";
    public static final String AFFILIATION_KEY = "affiliation";
    public static final String EMAIL_VERIFIED_KEY = "email_verified_flag";
    public static final String ACCOUNT_ENABLED_KEY = "enabled_flag";