CustomHeader


public class CustomHeader


A HTTP header name-value pair that will be sent on all requests to origins that match the given origin rules.

Summary

Public constructors

CustomHeader(
    @NonNull String name,
    @NonNull String value,
    @NonNull Set<String> originRules
)

Create a new custom header for the given name and value, to be added to requests that match the given origin originRules

Public methods

boolean

Two instances of CustomHeader are equal if the header name and value, and rule set are equal.

@NonNull String

HTTP Header name

@NonNull Set<String>

Origin patterns where this header is being sent.

@NonNull String

HTTP Header value

int

HashCode for CustomHeader is derived from the individual fields.-

Public constructors

CustomHeader

public CustomHeader(
    @NonNull String name,
    @NonNull String value,
    @NonNull Set<String> originRules
)

Create a new custom header for the given name and value, to be added to requests that match the given origin originRules

Parameters
@NonNull String name

A valid HTTP header name string

@NonNull String value

A valid HTTP value name string

@NonNull Set<String> originRules

a set of origin originRules following the same format as addWebMessageListener

Public methods

equals

public boolean equals(@Nullable Object obj)

Two instances of CustomHeader are equal if the header name and value, and rule set are equal.

getName

public @NonNull String getName()

HTTP Header name

getRules

public @NonNull Set<StringgetRules()

Origin patterns where this header is being sent.

The rules use the format described in the documentation for addWebMessageListener.

getValue

public @NonNull String getValue()

HTTP Header value

hashCode

public int hashCode()

HashCode for CustomHeader is derived from the individual fields.-