WebpushConfig.Builder

public static class WebpushConfig.Builder extends Object

Public Method Summary

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.

Inherited Method Summary

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.

发送以下问题的反馈:

此网页
需要帮助?请访问我们的支持页面