-
public class BatchUserDataEditorBatch User data editor
-
-
Method Summary
Modifier and Type Method Description BatchUserDataEditorsetLanguage(@Nullable() String language)Set the language of this user. BatchUserDataEditorsetRegion(@Nullable() String region)Set the region of this user. BatchUserDataEditorsetIdentifier(@Nullable() String identifier)Set the user identifier. BatchUserDataEditorsetAttribute(@NonNull() String key, long value)Set a custom user attribute for a key. BatchUserDataEditorsetAttribute(@NonNull() String key, double value)Set a custom user attribute for a key. BatchUserDataEditorsetAttribute(@NonNull() String key, boolean value)Set a custom user attribute for a key. BatchUserDataEditorsetAttribute(@NonNull() String key, @NonNull() Date value)Set a custom user attribute for a key. BatchUserDataEditorsetAttribute(@NonNull() String key, @NonNull() String value)Set a custom user attribute for a key. BatchUserDataEditorsetAttribute(@NonNull() String key, @NonNull() URI value)Set a custom user attribute for a key. BatchUserDataEditorremoveAttribute(@NonNull() String key)Removes a custom attribute. BatchUserDataEditorclearAttributes()Removes all attributes. BatchUserDataEditoraddTag(@NonNull() String collection, @NonNull() String tag)Add a tag in the specified collection. BatchUserDataEditorremoveTag(@NonNull() String collection, @NonNull() String tag)Removes a tag from a collection.Does nothing if the tag does not exist. BatchUserDataEditorclearTags()Removes all tags. BatchUserDataEditorclearTagCollection(@NonNull() String collection)Removes all tags from a collection.Does nothing if the tag collection does not exist. voidsave()Save all of the pending changes made in that editor.Note that this call may fail if Batch isn't started. -
-
Method Detail
-
setLanguage
BatchUserDataEditor setLanguage(@Nullable() String language)
Set the language of this user.Overrides the detected user language.
- Parameters:
language- lowercase, ISO 639 formatted string.
-
setRegion
BatchUserDataEditor setRegion(@Nullable() String region)
Set the region of this user.Overrides the detected user region.
- Parameters:
region- uppercase, ISO 3166 formatted string.
-
setIdentifier
BatchUserDataEditor setIdentifier(@Nullable() String identifier)
Set the user identifier.Be careful: you should make sure the identifier uniquely identifies a user. When pushing an identifier, all installations with that identifier will get the Push, which can cause some privacy issues if done wrong.
- Parameters:
identifier- Identifier string
-
setAttribute
BatchUserDataEditor setAttribute(@NonNull() String key, long value)
Set a custom user attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value.
-
setAttribute
BatchUserDataEditor setAttribute(@NonNull() String key, double value)
Set a custom user attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value.
-
setAttribute
BatchUserDataEditor setAttribute(@NonNull() String key, boolean value)
Set a custom user attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value.
-
setAttribute
BatchUserDataEditor setAttribute(@NonNull() String key, @NonNull() Date value)
Set a custom user attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null.
-
setAttribute
BatchUserDataEditor setAttribute(@NonNull() String key, @NonNull() String value)
Set a custom user attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null or empty.
-
setAttribute
BatchUserDataEditor setAttribute(@NonNull() String key, @NonNull() URI value)
Set a custom user attribute for a key.
- Parameters:
key- Attribute key, can't be null.value- Attribute value, can't be null or empty.
-
removeAttribute
BatchUserDataEditor removeAttribute(@NonNull() String key)
Removes a custom attribute.Does nothing if it was not set.
- Parameters:
key- Attribute key
-
clearAttributes
BatchUserDataEditor clearAttributes()
Removes all attributes.
-
addTag
BatchUserDataEditor addTag(@NonNull() String collection, @NonNull() String tag)
Add a tag in the specified collection. If empty, the collection will automatically be created.
- Parameters:
collection- The collection to add the tag to.tag- The tag to add.
-
removeTag
BatchUserDataEditor removeTag(@NonNull() String collection, @NonNull() String tag)
Removes a tag from a collection.Does nothing if the tag does not exist.
- Parameters:
collection- Collection nametag- Tag name
-
clearTags
BatchUserDataEditor clearTags()
Removes all tags.
-
clearTagCollection
BatchUserDataEditor clearTagCollection(@NonNull() String collection)
Removes all tags from a collection.Does nothing if the tag collection does not exist.
- Parameters:
collection- Tag collection.
-
save
void save()
Save all of the pending changes made in that editor.Note that this call may fail if Batch isn't started. In that case, your changes will be lost.Once you called "save", you need to get a new editor in order to make further changes.
This action cannot be undone.
-
-
-
-