So i am trying to implement custom userdetails in spring using kotlin data class. but when i implemented it and my ide started throwing declartion class errors so to get rid of it i made all the fields private.i can implement custom getters and setters but i really like to know if their is a way around it.
@Entity
@Table(name="user_table")
data class UserModel(
@Column(unique = true)
private var email: String,
@Column(unique = true)
private var username: String,
private var password: String,
private var date: Date,
private var authority: GrantedAuthority,
private var enabled: Boolean,
@Column(name="user_uuid",unique=true)
private var uuid: UUID,
@ManyToMany
var roles:List<RoleModel>,
@Id
@GeneratedValue(generator = "UUID")
var id: Long?=null
):UserDetails{
override fun getAuthorities(): MutableCollection<out GrantedAuthority> {
TODO("Not yet implemented")
}
override fun getPassword(): String {
TODO("Not yet implemented")
}
override fun getUsername(): String {
TODO("Not yet implemented")
}
override fun isAccountNonExpired(): Boolean {
TODO("Not yet implemented")
}
override fun isAccountNonLocked(): Boolean {
TODO("Not yet implemented")
}
override fun isCredentialsNonExpired(): Boolean {
TODO("Not yet implemented")
}
override fun isEnabled(): Boolean {
TODO("Not yet implemented")
}
}
and what concerns me the most is the thing mentioned at bottom of this question