Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package database.model;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.stereotype.Service;
- //@Configuration
- @Service
- public class User {
- private int id;
- private String login;
- private String password;
- private String username;
- private int privileges;
- /*******************
- ***** C-TOR *****
- ******************/
- @Autowired
- public User(int id, String login, String password, String username, int privileges) {
- this.id = id;
- this.login = login;
- this.password = password;
- this.username = username;
- this.privileges = privileges; //different than 0 if admin
- }
- /*
- @Bean
- public User user1(){
- return new User(1, "l", "p", "u", 1);
- }
- @Bean
- public User user2(){
- return new User(2, "l", "p", "u", 0);
- }
- */
- /*******************
- *** To-string ***
- ******************/
- @Override
- public String toString() {
- return "User [id=" + id + ", login=" + login + ", password=" + password + ", username=" + username
- + ", privileges=" + privileges + "]";
- }
- /*******************
- *** ACCESSORS ***
- ******************/
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getLogin() {
- return login;
- }
- public void setLogin(String login) {
- this.login = login;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public String getUsername() {
- return username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- public int getPrivileges() {
- return privileges;
- }
- public void setPrivileges(int privileges) {
- this.privileges = privileges;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement