Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.json.simple.JSONObject;
- public class Account {
- private int id;
- private String username;
- private String name;
- private String email;
- private String password;
- // public Account() {
- // }
- public Account(int id, String username, String name, String email, String password) {
- this.id = id;
- this.username = username;
- this.name = name;
- this.email = email;
- this.password = password;
- }
- public int getId() {
- return id;
- }
- public String getUsername() {
- return username;
- }
- public String getName() {
- return name;
- }
- public String getEmail() {
- return email;
- }
- protected String getPassword() {
- return password;
- }
- // public String toString() {
- // return "ID: " + getId() + ", Imie: " + getName() + ", Nick: " + getUsername() + ", email: " +getEmail();
- // }
- public JSONObject toJSON() {
- JSONObject jsonObject = new JSONObject();
- jsonObject.put("ID", id);
- jsonObject.put("Imie", name);
- jsonObject.put("Username", username);
- jsonObject.put("email", email);
- return jsonObject;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement