Package com.mparticle.identity
Class IdentityApiRequest.Builder
- java.lang.Object
-
- com.mparticle.identity.IdentityApiRequest.Builder
-
- Enclosing class:
- IdentityApiRequest
public static class IdentityApiRequest.Builder extends java.lang.Object
A class used for constructing IdentityApiRequest.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
protected
Builder(MParticleUser currentUser)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IdentityApiRequest
build()
Transform this class into an IdentityApiRequest which can be used withIdentityApi
request.IdentityApiRequest.Builder
customerId(java.lang.String customerId)
Set the IdentityType MParticle.IdentityType.CustomerId.IdentityApiRequest.Builder
email(java.lang.String email)
Set the IdentityType MParticle.IdentityType.Email.protected IdentityApiRequest.Builder
googleAdId(java.lang.String newGoogleAdId, java.lang.String oldGoogleAdId)
protected IdentityApiRequest.Builder
pushToken(java.lang.String newPushToken, java.lang.String oldPushToken)
IdentityApiRequest.Builder
userAliasHandler(UserAliasHandler userAliasHandler)
Deprecated.IdentityApiRequest.Builder
userIdentities(java.util.Map<MParticle.IdentityType,java.lang.String> userIdentities)
Set IdentityTypes in bulk.IdentityApiRequest.Builder
userIdentity(MParticle.IdentityType identityType, java.lang.String identityValue)
Set the value for the provided IdentityType key.
-
-
-
Constructor Detail
-
Builder
protected Builder(@Nullable MParticleUser currentUser)
-
Builder
protected Builder()
-
-
Method Detail
-
email
@NonNull public IdentityApiRequest.Builder email(@Nullable java.lang.String email)
Set the IdentityType MParticle.IdentityType.Email.- Parameters:
email
- the email to be set- Returns:
- the instance of the builder, for chaining calls
-
customerId
@NonNull public IdentityApiRequest.Builder customerId(@Nullable java.lang.String customerId)
Set the IdentityType MParticle.IdentityType.CustomerId.- Parameters:
customerId
- the customerId to be set- Returns:
- the instance of the builder, for chaining calls
-
pushToken
@NonNull protected IdentityApiRequest.Builder pushToken(@Nullable java.lang.String newPushToken, @Nullable java.lang.String oldPushToken)
-
googleAdId
@NonNull protected IdentityApiRequest.Builder googleAdId(@Nullable java.lang.String newGoogleAdId, @Nullable java.lang.String oldGoogleAdId)
-
userIdentity
@NonNull public IdentityApiRequest.Builder userIdentity(@NonNull MParticle.IdentityType identityType, @Nullable java.lang.String identityValue)
Set the value for the provided IdentityType key.- Parameters:
identityType
- the IdentityType to be setidentityValue
- the value the IdentityType should be set to- Returns:
- the instance of the builder, for chaining calls
- See Also:
MParticle.IdentityType
-
userIdentities
@NonNull public IdentityApiRequest.Builder userIdentities(@NonNull java.util.Map<MParticle.IdentityType,java.lang.String> userIdentities)
Set IdentityTypes in bulk.- Parameters:
userIdentities
- the IdentityTypes to be set- Returns:
- the instance of the builder, for chaining calls
- See Also:
MParticle.IdentityType
-
build
@NonNull public IdentityApiRequest build()
Transform this class into an IdentityApiRequest which can be used withIdentityApi
request.- Returns:
- an IdentityApiRequest
-
userAliasHandler
@Deprecated @NonNull public IdentityApiRequest.Builder userAliasHandler(@Nullable UserAliasHandler userAliasHandler)
Deprecated.Deprecated. To easily migrate your existing code, add a success listener to theBaseIdentityTask
that is being returned from this method )BaseIdentityTask.addSuccessListener(TaskSuccessListener)
. Within theIdentityApiResult
returned by the success listener, you can run the same code you do in youUserAliasHandler
, using theMParticleUser
s returned byIdentityApiResult.getUser()
andIdentityApiResult.getPreviousUser()
in place of "newUser" and "previousUser" respectively- Parameters:
userAliasHandler
-- Returns:
-
-