001/*
002 * Copyright 2012 Atteo.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.atteo.moonshine.shiro.simple;
017
018import java.util.List;
019
020import javax.xml.bind.annotation.XmlAttribute;
021import javax.xml.bind.annotation.XmlElement;
022import javax.xml.bind.annotation.XmlElementWrapper;
023
024import org.atteo.evo.config.XmlDefaultValue;
025
026/**
027 * Single user account.
028 */
029public class Account {
030    @XmlAttribute
031    private String username;
032
033    @XmlAttribute
034    private String password;
035
036    @XmlAttribute
037    @XmlDefaultValue("false")
038    private Boolean administrator;
039
040    @XmlElementWrapper(name = "roles")
041    @XmlElement(name = "role")
042    private List<String> roles;
043
044    public String getPassword() {
045        return password;
046    }
047
048    public List<String> getRoles() {
049        return roles;
050    }
051
052    public String getUsername() {
053        return username;
054    }
055
056    public boolean isAdministrator() {
057        return administrator;
058    }
059}