resourcepool / ssdp-client

The most lightweight asynchronous Java SSDP (Simple Service Discovery Protocol) Client
Apache License 2.0
53 stars 21 forks source link

problem using options #19

Closed Fahad-alkamli closed 4 years ago

Fahad-alkamli commented 4 years ago

when trying to use options using the example :

DiscoveryOptions options = DiscoveryOptions.builder() .intervalBetweenRequests(10000L) // optional interval between requests, defaults to 10 000 milliseconds .maxWaitTimeSeconds(3) // optional max wait time between req and response, defaults to 3 seconds .userAgent("Resourcepool SSDP Client") // optional custom user-agent, defaults to "Resourcepool SSDP Client" .build(); The problem is the build method is not static ? so who am I to call it just like that. It needs to be static to be called like that.

Fahad-alkamli commented 4 years ago

when trying to use options using the example :

DiscoveryOptions options = DiscoveryOptions.builder() .intervalBetweenRequests(10000L) // optional interval between requests, defaults to 10 000 milliseconds .maxWaitTimeSeconds(3) // optional max wait time between req and response, defaults to 3 seconds .userAgent("Resourcepool SSDP Client") // optional custom user-agent, defaults to "Resourcepool SSDP Client" .build(); The problem is the build method is not static ? so who am I to call it just like that. It needs to be static to be called like that.

or at least the code could be something like this: DiscoveryOptions something=new DiscoveryOptions(); DiscoveryOptions options = something.builder() .intervalBetweenRequests(10000L) // optional interval between requests, defaults to 10 000 milliseconds .maxWaitTimeSeconds(3) // optional max wait time between req and response, defaults to 3 seconds .userAgent("Resourcepool SSDP Client") // optional custom user-agent, defaults to "Resourcepool SSDP Client" .build();

Thanks!

loicortola commented 4 years ago

Hello Fahad, yes, you're right, just missed a static indicator on the builder() method. I just made this, will publish a fix today on central.

Thanks !