/* * Copyright 2016 Studentmediene i Trondheim AS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package no.dusken.momus.model; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Person { @Id private Long id; private String username; private String firstName; private String fullName; private String email; private String phoneNumber; private boolean active; public Person() { } public Person(Long id) { this.id = id; } public Person(Long id, String username, String firstName, String fullName, String email, String phoneNumber, boolean active) { this.id = id; this.username = username; this.firstName = firstName; this.fullName = fullName; this.email = email; this.phoneNumber = phoneNumber; this.active = active; } public Long getId() { return id; } public String getUsername() { return username; } public void setUsername(String userName) { this.username = userName; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getFullName() { return fullName; } public void setFullName(String lastName) { this.fullName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phone) { this.phoneNumber = phone; } public boolean isActive() { return active; } public void setActive(boolean active) { this.active = active; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Person person = (Person) o; if (id != null ? !id.equals(person.id) : person.id != null) return false; return true; } @Override public int hashCode() { return id != null ? id.hashCode() : 0; } @Override public String toString() { return "Person{" + "id=" + id + ", username='" + username + '\'' + ", fullName='" + fullName + '\'' + '}'; } }