Guest User

User

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