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;
* Created by gpietrus on 16.02.16.
*/
public class User {
// private UUID id; //todo: should be chosen by mongo?
private String username;
private String name;
private String password;
private String email;
public User(Document document) {
//todo: check nulls
this.username = document.get("username").toString();
this.name = document.get("name").toString();
this.password = document.get("password").toString();
this.email = document.get("password").toString();
}
public User(String username, String password) {
// this.id = id;
this.username = username;
public User(String username, String password, String email) {
this.name = username;
this.password = password;
this.email = email;
}
public String getUsername() {
return username;
public String getName() {
return name;
}
public void setUsername(String username) {
this.username = username;
public void setName(String name) {
this.name = name;
}
public String getPassword() {
......@@ -41,15 +41,18 @@ public class User {
this.password = password;
}
// public UUID getId()
// {
// return id;
// }
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
//todo: refactor mapping
public Map<String, Object> toMap() {
return ImmutableMap.<String, Object>builder()
.put("username", username)
.put("name", name)
.put("password", password)
.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