public class

UserInfo

extends Object
implements Parcelable Serializable
java.lang.Object
   ↳ com.sap.cloud.mobile.foundation.user.UserInfo

Class Overview

This class represent Information about user. This class is a Parcelable and can be passed around on different Activities.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<UserInfo> CREATOR Interface that must be implemented and provided as a public CREATOR field that generates instances of your Parcelable class from a Parcel.
Public Constructors
UserInfo(String userId, String userName, String[] roles)
Constructor to create UserInfo from userId, userName and array of roles.
Protected Constructors
UserInfo(Parcel in)
Constructor to support parcelable.
Public Methods
int describeContents()
This method is for the completion of Parcelable.
String getId()
Id of the current user.
String[] getRoles()
Returns an array for String listing the roles of current user.
String getUserName()
Get the user name for the current user.
void writeToParcel(Parcel parcel, int i)
Write the userInfo to the parcel
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<UserInfo> CREATOR

Interface that must be implemented and provided as a public CREATOR field that generates instances of your Parcelable class from a Parcel.

Public Constructors

public UserInfo (String userId, String userName, String[] roles)

Constructor to create UserInfo from userId, userName and array of roles.

Parameters
userId user id
userName user name
roles String array that contains the roles that the user belongs

Protected Constructors

protected UserInfo (Parcel in)

Constructor to support parcelable.

Parameters
in Parcel instance to create the UserInfo from.

Public Methods

public int describeContents ()

This method is for the completion of Parcelable. A simple implementation is used here.Write to parcel handles only one type of content.

Returns
  • zero(0) as default content type

public String getId ()

Id of the current user.

Returns
  • a String denoting the current user

public String[] getRoles ()

Returns an array for String listing the roles of current user.

Returns
  • Array of String of roles for the current user

public String getUserName ()

Get the user name for the current user.

Returns
  • User name for the current user

public void writeToParcel (Parcel parcel, int i)

Write the userInfo to the parcel

Parameters
parcel Instance of the destination parcel to which the UserInfo is written.
i not used in this implementation.