001/**
002 * Copyright 2014 Tampere University of Technology, Pori Department
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 service.tut.pori.users.google;
017
018import com.google.gson.annotations.SerializedName;
019
020import core.tut.pori.users.UserIdentity;
021
022/**
023 * A custom implementation of Google Credential with additional details for user account.
024 */
025public class GoogleCredential {
026  private transient UserIdentity _userId = null;
027  @SerializedName(value="id")
028  private String _id = null; // google user id
029  @SerializedName(value="name")
030  private String _name = null;
031  @SerializedName(value="given_name")
032  private String _givenName = null;
033  @SerializedName(value="family_name")
034  private String _familyName = null;
035  @SerializedName(value="link")
036  private String _link = null;
037  @SerializedName(value="picture")
038  private String _pictureLink = null;
039  @SerializedName(value="gender")
040  private String _gender = null;
041  @SerializedName(value="locale")
042  private String _locale = null;
043  
044  /**
045   * 
046   */
047  protected GoogleCredential(){
048    // nothing needed
049  }
050
051  /**
052   * @return the google user id
053   */
054  public String getId() {
055    return _id;
056  }
057
058  /**
059   * @return the userId
060   */
061  public UserIdentity getUserId() {
062    return _userId;
063  }
064  
065  /**
066   * @return the name
067   */
068  public String getName() {
069    return _name;
070  }
071
072  /**
073   * @return the givenName
074   */
075  public String getGivenName() {
076    return _givenName;
077  }
078
079  /**
080   * @return the familyName
081   */
082  public String getFamilyName() {
083    return _familyName;
084  }
085
086  /**
087   * @return the link
088   */
089  public String getLink() {
090    return _link;
091  }
092
093  /**
094   * @return the pictureLink
095   */
096  public String getPictureLink() {
097    return _pictureLink;
098  }
099
100  /**
101   * @return the gender
102   */
103  public String getGender() {
104    return _gender;
105  }
106
107  /**
108   * @return the locale
109   */
110  public String getLocale() {
111    return _locale;
112  }
113
114  /**
115   * 
116   * @param userId
117   */
118  protected void setUserId(UserIdentity userId){
119    _userId = userId;
120  }
121}