Guest User

User

a guest
Jan 7th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.54 KB | None | 0 0
  1. package com.example.student.first_machlakot;
  2.  
  3. import java.io.Serializable;
  4.  
  5. /**
  6.  * Created by student on 07/12/2017.
  7.  */
  8.  
  9. public class User implements Serializable {
  10.     protected String nameOfUser;
  11.     protected boolean gender; // True -> male , False -> female
  12.     protected int phone;
  13.     protected String email;
  14.     protected int password;
  15.     protected int id;
  16.     protected String place;
  17.     protected int numberOfAddedTresh;
  18.     protected int numberOfAddedThings;
  19.     protected int points;
  20. //All propartirs user
  21.     public User(String nameOfUser, boolean gender, int phone, String email, int password, int id, String place, int numberOfAddedTresh, int numberOfAddedThings, int points) {
  22.         this.nameOfUser = nameOfUser;
  23.         this.gender = gender;
  24.         this.phone = phone;
  25.         this.email = email;
  26.         this.password = password;
  27.         this.id = id;
  28.         this.place = place;
  29.         this.numberOfAddedTresh = numberOfAddedTresh;
  30.         this.numberOfAddedThings = numberOfAddedThings;
  31.         this.points = points;
  32.     }
  33. //No ID user
  34.     public User(String nameOfUser, boolean gender, int phone, String email, int password, String place, int numberOfAddedTresh, int numberOfAddedThings, int points) {
  35.         this.nameOfUser = nameOfUser;
  36.         this.gender = gender;
  37.         this.phone = phone;
  38.         this.email = email;
  39.         this.password = password;
  40.         this.place = place;
  41.         this.numberOfAddedTresh = numberOfAddedTresh;
  42.         this.numberOfAddedThings = numberOfAddedThings;
  43.         this.points = points;
  44.     }
  45. //Only email and password user
  46.     public User(String email, int password) {
  47.         this.email = email;
  48.         this.password = password;
  49.     }
  50. //Important things only+
  51.     public User(String nameOfUser, boolean gender, String email, int password) {
  52.         this.nameOfUser = nameOfUser;
  53.         this.gender = gender;
  54.         this.email = email;
  55.         this.password = password;
  56.     }
  57. //Copy function
  58.     public User(User user) {
  59.         this.nameOfUser = user.nameOfUser;
  60.         this.gender = user.gender;
  61.         this.phone = user.phone;
  62.         this.email = user.email;
  63.         this.password = user.password;
  64.         this.id = user.id;
  65.         this.place = user.place;
  66.         this.numberOfAddedTresh = user.numberOfAddedTresh;
  67.         this.numberOfAddedThings = user.numberOfAddedThings;
  68.         this.points = user.points;
  69.     }
  70.  
  71.     public String getNameOfUser() {
  72.         return nameOfUser;
  73.     }
  74.  
  75.     public void setNameOfUser(String nameOfUser) {
  76.         this.nameOfUser = nameOfUser;
  77.     }
  78.  
  79.     public boolean isGender() {
  80.         return gender;
  81.     }
  82.  
  83.     public void setGender(boolean gender) {
  84.         this.gender = gender;
  85.     }
  86.  
  87.     public int getPhone() {
  88.         return phone;
  89.     }
  90.  
  91.     public void setPhone(int phone) {
  92.         this.phone = phone;
  93.     }
  94.  
  95.     public String getEmail() {
  96.         return email;
  97.     }
  98.  
  99.     public void setEmail(String email) {
  100.         this.email = email;
  101.     }
  102.  
  103.     public int getPassword() {
  104.         return password;
  105.     }
  106.  
  107.     public void setPassword(int password) {
  108.         this.password = password;
  109.     }
  110.  
  111.     public int getId() {
  112.         return id;
  113.     }
  114.  
  115.     public void setId(int id) {
  116.         this.id = id;
  117.     }
  118.  
  119.     public String getPlace() {
  120.         return place;
  121.     }
  122.  
  123.     public void setPlace(String place) {
  124.         this.place = place;
  125.     }
  126.  
  127.     public int getNumberOfAddedTresh() {
  128.         return numberOfAddedTresh;
  129.     }
  130.  
  131.     public void setNumberOfAddedTresh(int numberOfAddedTresh) {
  132.         this.numberOfAddedTresh = numberOfAddedTresh;
  133.     }
  134.  
  135.     public int getNumberOfAddedThings() {
  136.         return numberOfAddedThings;
  137.     }
  138.  
  139.     public void setNumberOfAddedThings(int numberOfAddedThings) {
  140.         this.numberOfAddedThings = numberOfAddedThings;
  141.     }
  142.  
  143.     public int getPoints() {
  144.         return points;
  145.     }
  146.  
  147.     public void setPoints(int points) {
  148.         this.points = points;
  149.     }
  150.  
  151.     @Override
  152.     public String toString() {
  153.         return "User{" +
  154.                 "nameOfUser='" + nameOfUser + '\'' +
  155.                 ", gender=" + gender +
  156.                 ", phone=" + phone +
  157.                 ", email='" + email + '\'' +
  158.                 ", password=" + password +
  159.                 ", id=" + id +
  160.                 ", place='" + place + '\'' +
  161.                 ", numberOfAddedTresh=" + numberOfAddedTresh +
  162.                 ", numberOfAddedThings=" + numberOfAddedThings +
  163.                 ", points=" + points +
  164.                 '}';
  165.     }
  166. }
Add Comment
Please, Sign In to add comment