Yaaic/application/src/org/yaaic/model/Identity.java

121 lines
2.6 KiB
Java
Raw Normal View History

/*
Yaaic - Yet Another Android IRC Client
2012-01-21 17:12:55 -05:00
Copyright 2009-2012 Sebastian Kaspari
This file is part of Yaaic.
Yaaic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Yaaic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
2011-01-25 15:02:27 -05:00
*/
package org.yaaic.model;
2010-09-06 22:07:40 -04:00
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* An identity containing a nickname, an ident and a real name
*
* @author Sebastian Kaspari <sebastian@yaaic.org>
*/
public class Identity
{
2010-11-18 12:52:19 -05:00
private String nickname;
2011-01-25 15:02:27 -05:00
private final List<String> aliases = new ArrayList<String>();
2010-11-18 12:52:19 -05:00
private String ident;
private String realname;
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* Set the nickname of this identity
*
* @param nickname The nickname to be set
*/
public void setNickname(String nickname)
{
this.nickname = nickname;
}
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* Get the nickname of this identity
2011-03-14 17:15:13 -04:00
*
2010-11-18 12:52:19 -05:00
* @return The nickname
*/
public String getNickname()
{
return nickname;
}
2011-01-25 15:02:27 -05:00
2011-03-14 17:15:13 -04:00
/**
* Set a collection of aliases for this identity
*
* @param aliases
*/
public void setAliases(Collection<String> aliases)
{
2010-11-18 12:52:19 -05:00
this.aliases.clear();
this.aliases.addAll(aliases);
}
2011-01-25 15:02:27 -05:00
2011-03-14 17:15:13 -04:00
/**
* Get all aliases for this identity
*
* @return
*/
public List<String> getAliases()
{
2010-11-18 12:52:19 -05:00
return Collections.unmodifiableList(aliases);
}
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* Set the ident of this identity
*
* @param ident The ident to be set
*/
public void setIdent(String ident)
{
this.ident = ident;
}
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* Get the ident of this identity
*
* @return The identity
*/
public String getIdent()
{
return ident;
}
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* Set the real name of this identity
*
* @param realname The real name to be set
*/
public void setRealName(String realname)
{
this.realname = realname;
}
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* Get the real name of this identity
*
* @return The realname
*/
public String getRealName()
{
return realname;
}
}