public static class

WebpushConfig.Builder

extends Object
java.lang.Object
   ↳ com.google.firebase.messaging.WebpushConfig.Builder

Summary

Public Methods
WebpushConfig build()
Creates a new WebpushConfig instance from the parameters set on this builder.
WebpushConfig.Builder putAllData(Map<String, String> map)
Adds all the key-value pairs in the given map as Webpush data fields.
WebpushConfig.Builder putAllHeaders(Map<String, String> map)
Adds all the key-value pairs in the given map as Webpush headers.
WebpushConfig.Builder putData(String key, String value)
Sets the given key-value pair as a Webpush data field.
WebpushConfig.Builder putHeader(String key, String value)
Adds the given key-value pair as a Webpush HTTP header.
WebpushConfig.Builder setNotification(WebpushNotification notification)
Sets the Webpush notification to be included in the message.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public WebpushConfig build ()

Creates a new WebpushConfig instance from the parameters set on this builder.

Returns
Throws
IllegalArgumentException If any of the parameters set on the builder are invalid.

public WebpushConfig.Builder putAllData (Map<String, String> map)

Adds all the key-value pairs in the given map as Webpush data fields. When set, overrides any data fields set using the methods putData(String, String) and putAllData(Map).

Parameters
map A non-null map of data values. Map must not contain null keys or values.
Returns
  • This builder.

public WebpushConfig.Builder putAllHeaders (Map<String, String> map)

Adds all the key-value pairs in the given map as Webpush headers. Refer to Webpush specification for supported headers.

Parameters
map A non-null map of header values. Map must not contain null keys or values.
Returns
  • This builder.

public WebpushConfig.Builder putData (String key, String value)

Sets the given key-value pair as a Webpush data field. When set, overrides any data fields set using the methods putData(String, String) and putAllData(Map).

Parameters
key Name of the data field. Must not be null.
value Value of the data field. Must not be null.
Returns
  • This builder.

public WebpushConfig.Builder putHeader (String key, String value)

Adds the given key-value pair as a Webpush HTTP header. Refer to Webpush specification for supported headers.

Parameters
key Name of the header. Must not be null.
value Value of the header. Must not be null.
Returns
  • This builder.

public WebpushConfig.Builder setNotification (WebpushNotification notification)

Sets the Webpush notification to be included in the message.

Parameters
notification A WebpushNotification instance.
Returns
  • This builder.