Class Profile
- java.lang.Object
-
- com.cheetahdigital.corekit.models.BaseModel
-
- com.cheetahdigital.profile.core.model.Profile
-
public class Profile extends BaseModel
Cheetah Loyalty - Profile
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceProfile.ModeTypeAnnotation for different Mode Types
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(java.lang.String key)Returns the object paired with the keybooleangetAsBoolean(java.lang.String key)Returns the boolean value of the member attribute for the keyjava.util.DategetAsDate(java.lang.String key)Returns the Date value of the member attribute for the keydoublegetAsDouble(java.lang.String key)Returns the double value of the member attribute for the keyintgetAsInt(java.lang.String key)Returns the int value of the member attribute for the keyjava.lang.StringgetAsString(java.lang.String key)Returns the String value of the member attribute for the key Forces the value to be a string by calling thetoString()method of the objectjava.util.List<Metadata>getMetadata()Returns the list ofMetadataassociated to profilejava.lang.StringgetValue(ProfileFieldView view)Returns the value of the profile attribute based on theProfileFieldView.getFieldName()voidput(java.lang.String key, java.lang.Object object)Puts the object mapped to the keyvoidset(ProfileFieldView view)Sets the value of the profile attribute based on theProfileFieldView.getFieldName()voidset(java.lang.String key, java.lang.Object value)Sets the value of the profile attribute based on the keyvoidsetMetadata(java.util.List<Metadata> metadata)Sets the metadata of the profile-
Methods inherited from class com.cheetahdigital.corekit.models.BaseModel
getData, getMessage, isSuccess, setData, setMessage, setSuccess
-
-
-
-
Field Detail
-
GMT
public static final java.lang.String GMT
- See Also:
- Constant Field Values
-
VIEW
public static final java.lang.String VIEW
- See Also:
- Constant Field Values
-
EDIT
public static final java.lang.String EDIT
- See Also:
- Constant Field Values
-
VIEW_EDIT
public static final java.lang.String VIEW_EDIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Profile
public Profile(java.util.List<Metadata> metadata)
Public constructor for Profile- Parameters:
metadata-ListofMetadatafrom the API call to api/describeProfileAPI.getProfileMetadata(ProfileParams, boolean, Listener)
-
-
Method Detail
-
getMetadata
public java.util.List<Metadata> getMetadata()
Returns the list ofMetadataassociated to profile- Returns:
- the
ListofMetadatafor this environment
-
setMetadata
public void setMetadata(java.util.List<Metadata> metadata)
Sets the metadata of the profile- Parameters:
metadata- list ofMetadatafor current profile
-
getAsBoolean
public boolean getAsBoolean(java.lang.String key) throws java.lang.ClassCastExceptionReturns the boolean value of the member attribute for the key- Parameters:
key- name of the member attribute, must match name in metadata- Returns:
- the value of the member attribute with key
- Throws:
java.lang.ClassCastException- if the key is not of typeMetadata.BOOLEAN
-
getAsDate
public java.util.Date getAsDate(java.lang.String key) throws java.lang.ClassCastExceptionReturns the Date value of the member attribute for the key- Parameters:
key- name of the member attribute, must match name in metadata- Returns:
- the
Datevalue of the member attribute with key - Throws:
java.lang.ClassCastException- if the key is not of typeMetadata.DATEorMetadata.DATETIME
-
getAsDouble
public double getAsDouble(java.lang.String key) throws java.lang.ClassCastExceptionReturns the double value of the member attribute for the key- Parameters:
key- name of the member attribute, must match the name in metadata- Returns:
- the
doublevalue of the member attribute with key - Throws:
java.lang.ClassCastException- if the key is not of typeMetadata.DECIMAL
-
getAsInt
public int getAsInt(java.lang.String key) throws java.lang.ClassCastExceptionReturns the int value of the member attribute for the key- Parameters:
key- name of the member attribute, must match the name in metadata- Returns:
- the
intvalue of the member attribute with key - Throws:
java.lang.ClassCastException- if the key is not of typeMetadata.INTEGER
-
getAsString
public java.lang.String getAsString(java.lang.String key)
Returns the String value of the member attribute for the key Forces the value to be a string by calling thetoString()method of the object- Parameters:
key- name of the member attribute, must match the name in metadata- Returns:
- value if not empty or null else empty string
-
set
public void set(@NonNull ProfileFieldView view)Sets the value of the profile attribute based on theProfileFieldView.getFieldName()- Parameters:
view-ProfileFieldView
-
set
public void set(java.lang.String key, java.lang.Object value)Sets the value of the profile attribute based on the key- Parameters:
key- metadata namevalue- value of the object
-
getValue
public java.lang.String getValue(@NonNull ProfileFieldView view)Returns the value of the profile attribute based on theProfileFieldView.getFieldName()- Parameters:
view-ProfileFieldView- Returns:
- String value of the attribute
-
get
public java.lang.Object get(java.lang.String key)
Returns the object paired with the key- Parameters:
key- key/name of the member attribute- Returns:
- the member attribute value
-
put
public void put(java.lang.String key, java.lang.Object object)Puts the object mapped to the key- Parameters:
key-keyof the member attribute (e.g. first_name for First Name)object- value of the member attribute
-
-