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.ObjectA class used for constructing IdentityApiRequest.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()protectedBuilder(MParticleUser currentUser)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IdentityApiRequestbuild()Transform this class into an IdentityApiRequest which can be used withIdentityApirequest.IdentityApiRequest.BuildercustomerId(java.lang.String customerId)Set the IdentityType MParticle.IdentityType.CustomerId.IdentityApiRequest.Builderemail(java.lang.String email)Set the IdentityType MParticle.IdentityType.Email.protected IdentityApiRequest.BuildergoogleAdId(java.lang.String newGoogleAdId, java.lang.String oldGoogleAdId)protected IdentityApiRequest.BuilderpushToken(java.lang.String newPushToken, java.lang.String oldPushToken)IdentityApiRequest.BuilderuserAliasHandler(UserAliasHandler userAliasHandler)Deprecated.IdentityApiRequest.BuilderuserIdentities(java.util.Map<MParticle.IdentityType,java.lang.String> userIdentities)Set IdentityTypes in bulk.IdentityApiRequest.BuilderuserIdentity(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 withIdentityApirequest.- 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 theBaseIdentityTaskthat is being returned from this method )BaseIdentityTask.addSuccessListener(TaskSuccessListener). Within theIdentityApiResultreturned by the success listener, you can run the same code you do in youUserAliasHandler, using theMParticleUsers returned byIdentityApiResult.getUser()andIdentityApiResult.getPreviousUser()in place of "newUser" and "previousUser" respectively- Parameters:
userAliasHandler-- Returns:
-
-