WifiP2pUsdBasedServiceConfig.Builder


public static final class WifiP2pUsdBasedServiceConfig.Builder
extends Object

java.lang.Object
   ↳ android.net.wifi.p2p.nsd.WifiP2pUsdBasedServiceConfig.Builder


Builder used to build WifiP2pUsdBasedServiceConfig objects for USD based service discovery and advertisement.

Summary

Public constructors

Builder(String serviceName)

Constructor for Builder.

Public methods

WifiP2pUsdBasedServiceConfig build()

Build WifiP2pUsdBasedServiceConfig given the current requests made on the builder.

WifiP2pUsdBasedServiceConfig.Builder setServiceProtocolType(int serviceProtocolType)

Specify the service discovery protocol type.

WifiP2pUsdBasedServiceConfig.Builder setServiceSpecificInfo(byte[] serviceSpecificInfo)

Specify service specific information content determined by the application.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

public Builder (String serviceName)

Constructor for Builder.

Parameters
serviceName String: The service name defining the service. The maximum allowed length of the service name is 100 characters. This value cannot be null.

Public methods

build

public WifiP2pUsdBasedServiceConfig build ()

Build WifiP2pUsdBasedServiceConfig given the current requests made on the builder.

Returns
WifiP2pUsdBasedServiceConfig WifiP2pUsdBasedServiceConfig constructed based on builder method calls. This value cannot be null.

setServiceProtocolType

public WifiP2pUsdBasedServiceConfig.Builder setServiceProtocolType (int serviceProtocolType)

Specify the service discovery protocol type.

Optional. SERVICE_PROTOCOL_TYPE_GENERIC by default.

Parameters
serviceProtocolType int: One of the SERVICE_PROTOCOL_TYPE_* or a non-negative number set by the service layer. Value is between 0 and 255 inclusive

Returns
WifiP2pUsdBasedServiceConfig.Builder The builder to facilitate chaining builder.setXXX(..).setXXX(..). This value cannot be null.

setServiceSpecificInfo

public WifiP2pUsdBasedServiceConfig.Builder setServiceSpecificInfo (byte[] serviceSpecificInfo)

Specify service specific information content determined by the application.

Optional. Empty by default.

Parameters
serviceSpecificInfo byte: A byte-array of service-specific information available to the application to send additional information. Users must call WifiP2pUsdBasedServiceConfig.getMaxAllowedServiceSpecificInfoLength() method to know maximum allowed legth. This value may be null.

Returns
WifiP2pUsdBasedServiceConfig.Builder The builder to facilitate chaining builder.setXXX(..).setXXX(..). This value cannot be null.