Skip to content

Code clarity on MulticastMessage class #280

@NunuM

Description

@NunuM

Environment

  • Firebase SDK version: 6.8.1
  • Firebase Product: messaging

Problem

The class com.google.firebase.messaging.MulticastMessage represents the concept of one message for multiple targets. The companion class com.google.firebase.messaging.MulticastMessage.Builder accepts as an argument a java.util.List of targets (addAllTokens method). The data type associated (List) allows repeated elements, in other words, we can build a MulticastMessage instance, that has a list of repeated targets.

I presume that in server side this will be unmarshalled to a Set data type. On MulticastMessage constructor can I change it to eliminate repeated elements and make a PR. Or this is meant to be like this?

Thanks.

Relevant Code:

// Internal data-structure for 'tokens' attribute on MulticastMessage class
final ImmutableList.Builder<String> objectBuilder = ImmutableList.builder();

objectBuilder.add("one");
objectBuilder.add("one");

final ImmutableList<String> build = objectBuilder.build();

System.out.println(build); // [one, one]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions