Commit 4a43d17f authored by Gabriele Civitarese's avatar Gabriele Civitarese

Small refactoring

parent 484d8f65
...@@ -17,9 +17,10 @@ public class Users { ...@@ -17,9 +17,10 @@ public class Users {
@XmlElement(name="users") @XmlElement(name="users")
private List<User> userslist; private List<User> userslist;
private static Users instance; private static Users instance;
public Users() { private Users() {
userslist = new ArrayList<User>(); userslist = new ArrayList<User>();
} }
...@@ -31,10 +32,12 @@ public class Users { ...@@ -31,10 +32,12 @@ public class Users {
} }
public synchronized List<User> getUserslist() { public synchronized List<User> getUserslist() {
return new ArrayList<>(userslist); return new ArrayList<>(userslist);
} }
public void setUserslist(List<User> userslist) { public synchronized void setUserslist(List<User> userslist) {
this.userslist = userslist; this.userslist = userslist;
} }
......
...@@ -28,13 +28,16 @@ public class HelloWorld { ...@@ -28,13 +28,16 @@ public class HelloWorld {
@GET @GET
@Produces("application/json") @Produces("application/json")
public String helloWorld2(){ public String helloWorld2(){
return "{\"message\": \"helloWorld\"}"; return "{\"message\": \"helloWorld\"}";
} }
@Path("/inner") @Path("inner")
@GET @GET
@Produces("text/plain") @Produces("text/plain")
public String innerHello(){ public String innerHello(){
return "Inner Hello!"; return "Inner Hello!";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment