All Downloads are FREE. Search and download functionalities are using the official Maven repository.

leap.web.security.user.SimpleUserDetails Maven / Gradle / Ivy

There is a newer version: 0.7.13b
Show newest version
/*
 * Copyright 2013 the original author or authors.
 *
 * 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 leap.web.security.user;

public class SimpleUserDetails implements UserDetails {

	protected Object id;
	protected String name;
	protected String loginName;
    protected String password;
	protected String firstName;
	protected String lastName;

	public SimpleUserDetails() {
	}

	public Object getId() {
		return id;
	}

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

	public String getName() {
		if(null == name) {
			if(null != firstName) {
				name = firstName + " " + lastName;
			}else{
				name = getLoginName();
			}
		}
		return name;
	}

	public void setName(String nickName) {
		this.name = nickName;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String name) {
		this.loginName = name;
	}

    @Override
    public String getPassword() {
        return password;
    }

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

    public String getDisplayName() {
		return getName();
	}
	
	public void setDisplayName(String displayName) {
		this.name = displayName;
	}

	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;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy