Spark Java Article BAEL-498 (#912)
* Initial Commit for Spark Java Article BAEL-498 * reverting main pom.xml and rollbacking accidental changes. * Changes as per review: 1. Added UserService 2. Renamed UserStore to UserServiceMapImpl 3. Removed Empty spaces in User.java 4. Removed AppTest 5. Changes in SparkRestExample for using UserServiceMapImp instead of UserStore static functions. * Suggested changes in print messages. * Changes as per comments on github... for PR: https://github.com/eugenp/tutorials/pull/912 * Changes in editUser function as per guidance by Kevin. * Clean up * added 1.8 config for pom.xml * Clean up. * Removed junit dep. * Added Application/json in response type.
This commit is contained in:
committed by
KevinGilmore
parent
117635f955
commit
ad63b55edb
59
spark-java/src/main/java/com/baeldung/sparkjava/User.java
Normal file
59
spark-java/src/main/java/com/baeldung/sparkjava/User.java
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.baeldung.sparkjava;
|
||||
|
||||
class User {
|
||||
|
||||
private String id;
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
private String email;
|
||||
|
||||
public User(String id, String firstName, String lastName, String email) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
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 getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuffer().append(getEmail()).toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user