package com.its.wthr.webapp.vo;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.ArrayList;
import java.util.List;

public class UserVo implements UserDetails{

	private static final long serialVersionUID = 1L;
	private String id;
	private String password;
	private List<GrantedAuthority> authorities = new ArrayList<>();

	public UserVo(String id, String password) {
		this.id = id;
		this.password = password;
	}

	public UserVo() {
	}

	public String getUsername() {
		return this.id;
	}

	public boolean isAccountNonExpired() {
		return true;
	}

	public boolean isAccountNonLocked() {
		return true;
	}

	public boolean isCredentialsNonExpired() {
		return true;
	}

	public boolean isEnabled() {
		return true;
	}

	public String getId() {
		return this.id;
	}

	public String getPassword() {
		return this.password;
	}

	public List<GrantedAuthority> getAuthorities() {
		return this.authorities;
	}

	public void setId(final String id) {
		this.id = id;
	}

	public void setPassword(final String password) {
		this.password = password;
	}

	public void setAuthorities(final List<GrantedAuthority> authorities) {
		this.authorities = authorities;
	}

	public String toString() {
		return "voUser(id=" + this.getId() + ", password=" + this.getPassword() + ", authorities="
				+ this.getAuthorities() + ")";
	}
}