Commit ad3e143e authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

add new objects

parent f345a3c0
package objects;
/**
* Created by gpietrus on 20.02.2016.
*/
public class Flag {
}
package objects;
/**
* Created by gpietrus on 20.02.2016.
*/
public class Task {
private String name;
private int level;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
}
package objects;
/**
* Created by gpietrus on 20.02.2016.
*/
public class Team {
private String name;
private String description;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
...@@ -9,28 +9,28 @@ import java.util.Map; ...@@ -9,28 +9,28 @@ import java.util.Map;
* Created by gpietrus on 16.02.16. * Created by gpietrus on 16.02.16.
*/ */
public class User { public class User {
// private UUID id; //todo: should be chosen by mongo? private String name;
private String username;
private String password; private String password;
private String email;
public User(Document document) { public User(Document document) {
//todo: check nulls this.name = document.get("name").toString();
this.username = document.get("username").toString();
this.password = document.get("password").toString(); this.password = document.get("password").toString();
this.email = document.get("password").toString();
} }
public User(String username, String password) { public User(String username, String password, String email) {
// this.id = id; this.name = username;
this.username = username;
this.password = password; this.password = password;
this.email = email;
} }
public String getUsername() { public String getName() {
return username; return name;
} }
public void setUsername(String username) { public void setName(String name) {
this.username = username; this.name = name;
} }
public String getPassword() { public String getPassword() {
...@@ -41,15 +41,18 @@ public class User { ...@@ -41,15 +41,18 @@ public class User {
this.password = password; this.password = password;
} }
// public UUID getId() public String getEmail() {
// { return email;
// return id; }
// }
public void setEmail(String email) {
this.email = email;
}
//todo: refactor mapping //todo: refactor mapping
public Map<String, Object> toMap() { public Map<String, Object> toMap() {
return ImmutableMap.<String, Object>builder() return ImmutableMap.<String, Object>builder()
.put("username", username) .put("name", name)
.put("password", password) .put("password", password)
.build(); .build();
} }
......
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