Class DiscoveryResultBuilder


  • @NonNullByDefault
    public class DiscoveryResultBuilder
    extends Object
    The DiscoveryResultBuilder helps creating a DiscoveryResult through the builder pattern.
    Author:
    Kai Kreuzer - Initial contribution, Andre Fuechsel - added support for time to live, Thomas Höfer - Added representation
    See Also:
    DiscoveryResult
    • Method Detail

      • withProperties

        public DiscoveryResultBuilder withProperties​(@Nullable Map<String,​Object> properties)
        Adds properties to the desired result.
        Parameters:
        properties - of the desired result
        Returns:
        the updated builder
      • withProperty

        public DiscoveryResultBuilder withProperty​(String key,
                                                   Object value)
        Adds a property to the desired result.
        Parameters:
        property - of the desired result
        Returns:
        the updated builder
      • withRepresentationProperty

        public DiscoveryResultBuilder withRepresentationProperty​(@Nullable String representationProperty)
        Sets the representation Property of the desired result.
        Parameters:
        representationProperty - the representation property of the desired result
        Returns:
        the updated builder
      • withBridge

        public DiscoveryResultBuilder withBridge​(@Nullable ThingUID bridgeUID)
        Sets the bridgeUID of the desired result.
        Parameters:
        bridgeUID - of the desired result
        Returns:
        the updated builder
      • withLabel

        public DiscoveryResultBuilder withLabel​(@Nullable String label)
        Sets the label of the desired result.
        Parameters:
        label - of the desired result
        Returns:
        the updated builder
      • withTTL

        public DiscoveryResultBuilder withTTL​(long ttl)
        Sets the time to live for the result in seconds.
        Parameters:
        ttl - time to live in seconds
        Returns:
        the updated builder
      • build

        public DiscoveryResult build()
        Builds a result with the settings of this builder.
        Returns:
        the desired result