Język

DiscoveryRequest.Builder.SetAttributeFilters Method

Definition

Set filters based on service attributes.

[Android.Runtime.Register("setAttributeFilters", "(Ljava/util/Map;)Landroid/net/nsd/DiscoveryRequest$Builder;", "", ApiSince=37)]
public Android.Net.Nsd.DiscoveryRequest.Builder SetAttributeFilters(System.Collections.Generic.IDictionary<string,Android.OS.PatternMatcher>? attributeFilters);
[<Android.Runtime.Register("setAttributeFilters", "(Ljava/util/Map;)Landroid/net/nsd/DiscoveryRequest$Builder;", "", ApiSince=37)>]
member this.SetAttributeFilters : System.Collections.Generic.IDictionary<string, Android.OS.PatternMatcher> -> Android.Net.Nsd.DiscoveryRequest.Builder

Parameters

attributeFilters
IDictionary<String,PatternMatcher>

A map of attribute key -> filter for that attribute value. This value may be null.

Returns

Attributes

Remarks

Set filters based on service attributes.

Service attributes are as per NsdServiceInfo.getAttributes().

Keys of the provided map should match attribute keys. As per RFC6763 6.4. attribute keys are expected to be printable US-ASCII values (0x20-0x7E), and the key matching is not case-sensitive.

Values of the map are matchers that will be checked against attributes value bytes read as uppercase hexadecimal if the pattern starts with 0x, or using UTF-8 encoding if it does not. Value matching is case-sensitive.

If a map value is null, the corresponding attribute will be expected to be a boolean attribute with no value as per RFC6763 6.4.

If a null or empty map is passed, no filtering will be done based on attributes (the default).

Android reference for android.net.nsd.DiscoveryRequest.Builder.setAttributeFilters.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to