blob: fa50095424d9a9649aca148eadaca300c0f564be [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 org.apache.openmeetings.db.dto.user;
import java.util.ArrayList;
import java.util.List;
import org.apache.openmeetings.db.entity.user.Address;
import org.apache.openmeetings.db.entity.user.User;
import org.apache.openmeetings.db.entity.user.User.Right;
import org.apache.openmeetings.db.entity.user.User.Type;
public class UserDTO {
private Long id;
private String firstname;
private String lastname;
private List<String> rights;
private String login;
private Long language_id;
private Address adresses;
private String timeZoneId;
private Type type = Type.user;
public UserDTO() {}
public UserDTO(User u) {
id = u.getUser_id();
firstname = u.getFirstname();
lastname = u.getLastname();
rights = new ArrayList<>();
for (Right r : u.getRights()) {
rights.add(r.name());
}
login = u.getLogin();
language_id = u.getLanguage_id();
adresses = u.getAdresses();
timeZoneId = u.getTimeZoneId();
type = u.getType();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public List<String> getRights() {
return rights;
}
public void setRights(List<String> rights) {
this.rights = rights;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public Long getLanguage_id() {
return language_id;
}
public void setLanguage_id(Long language_id) {
this.language_id = language_id;
}
public Address getAdresses() {
return adresses;
}
public void setAdresses(Address adresses) {
this.adresses = adresses;
}
public String getTimeZoneId() {
return timeZoneId;
}
public void setTimeZoneId(String timeZoneId) {
this.timeZoneId = timeZoneId;
}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
}