package com.giannoules.proxstor.user;

import com.tinkerpop.blueprints.Vertex;
import javax.xml.bind.annotation.XmlRootElement;

/*
 * JAXB representation of a ProxStor user
 *      @TODO move out to separate package/jar for client use as well
 *
 * 2014/08/19 - updated to accept com.tinkerpop.blueprints.Vertex in constructor
 */


@XmlRootElement
public class User {
    public String userId;
    public String firstName;
    public String lastName;
    public String address;
    
    public User() {}
    
    
    /*
    public User(Vertex v) {
         firstName = v.getProperty("firstName");
         lastName = v.getProperty("lastName");
         address = v.getProperty("address");
         Object id = v.getId();
         if (id instanceof Long) {            
            userId = Long.toString((Long) v.getId());
         } else {
             userId = v.getId().toString();
         }
        
    }
    */
    
    public User(String firstName, String lastName, String address) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.address = address;
    }
    
    public String getUserId() {
        return userId;
    }
    
    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
    
}

@@ -38,49 +38,8 @@
 %0D%0A%0D%0A
-import com.tinkerpop.blueprints.Vertex;%0D%0A
 impo
@@ -295,20 +295,16 @@
 r%0D%0A */%0D%0A
-%0D%0A%0D%0A
 @XmlRoot
@@ -329,24 +329,26 @@
 ass User %7B%0D%0A
+%0D%0A
     public S
@@ -449,20 +449,16 @@
 dress;%0D%0A
-    
 %0D%0A    pu
@@ -474,445 +474,17 @@
 () %7B
-%7D%0D%0A    %0D%0A    %0D%0A    /*%0D%0A    public User(Vertex v) %7B%0D%0A         firstName = v.getProperty(%22firstName%22);%0D%0A         lastName = v.getProperty(%22lastName%22);%0D%0A         address = v.getProperty(%22address%22);%0D%0A         Object id = v.getId();%0D%0A         if (id instanceof Long) %7B            %0D%0A            userId = Long.toString((Long) v.getId());%0D%0A         %7D else %7B%0D%0A             userId = v.getId().toString();%0D%0A         %7D%0D%0A        %0D%0A    %7D%0D%0A    */
 %0D%0A    
+%7D%0D%0A
 %0D%0A  
@@ -655,36 +655,32 @@
 ddress;%0D%0A    %7D%0D%0A
-    
 %0D%0A    public Str
@@ -729,20 +729,16 @@
 %0A    %7D%0D%0A
-    
 %0D%0A    pu
@@ -1299,17 +1299,13 @@
 %0A    %7D%0D%0A
-    
 %0D%0A%7D%0D%0A

clean up minor formatting and imports