View Javadoc

1   /*
2    * Copyright (c) 2002-2014, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.digglike.business;
35  
36  import fr.paris.lutece.portal.service.security.LuteceUser;
37  
38  
39  public class DiggUserInfo
40  {
41      private String _strLuteceUserKey;
42      private String _strFirstName;
43      private String _strLastName;
44      private String _strBusinnessMail;
45      private String _strHomeMail;
46      private String _strLogin;
47  
48      public String getLuteceUserKey(  )
49      {
50          return _strLuteceUserKey;
51      }
52  
53      public void setLuteceUserKey( String strKey )
54      {
55          this._strLuteceUserKey = strKey;
56      }
57  
58      public String getFirstName(  )
59      {
60          return _strFirstName;
61      }
62  
63      public void setFirstName( String strFirstName )
64      {
65          this._strFirstName = strFirstName;
66      }
67  
68      public String getLastName(  )
69      {
70          return _strLastName;
71      }
72  
73      public void setLastName( String strLastName )
74      {
75          this._strLastName = strLastName;
76      }
77  
78      public String getBusinessMail(  )
79      {
80          return _strBusinnessMail;
81      }
82  
83      public void setBusinesMail( String strMail )
84      {
85          this._strBusinnessMail = strMail;
86      }
87  
88      public String getHomeMail(  )
89      {
90          return _strHomeMail;
91      }
92  
93      public void setHomeMail( String strMail )
94      {
95          this._strHomeMail = strMail;
96      }
97  
98      public String getLogin(  )
99      {
100         return _strLogin;
101     }
102 
103     public void setLogin( String strLogin )
104     {
105         this._strLogin = strLogin;
106     }
107 
108     /**
109      * Gets a user's info
110      * @param key The info key
111      * @return The info value
112      */
113     public String getUserInfo( String key )
114     {
115         String strReturn = null;
116 
117         if ( key != null )
118         {
119             if ( key.equals( LuteceUser.NAME_GIVEN ) )
120             {
121                 strReturn = getFirstName(  );
122             }
123             else if ( key.equals( LuteceUser.NAME_FAMILY ) )
124             {
125                 strReturn = getLastName(  );
126             }
127             else if ( key.equals( LuteceUser.BUSINESS_INFO_ONLINE_EMAIL ) )
128             {
129                 strReturn = getBusinessMail(  );
130             }
131 
132             else if ( key.equals( LuteceUser.HOME_INFO_ONLINE_EMAIL ) )
133             {
134                 strReturn = getHomeMail(  );
135             }
136         }
137 
138         return strReturn;
139     }
140 
141     /**
142      * toString implementation
143      * @return The login
144      */
145     public String toString(  )
146     {
147         return getLogin(  );
148     }
149 }