Class ThingStatusInfoBuilder

java.lang.Object
org.openhab.core.thing.binding.builder.ThingStatusInfoBuilder

@NonNullByDefault public class ThingStatusInfoBuilder extends Object
ThingStatusInfoBuilder is responsible for creating ThingStatusInfos.
Author:
Stefan Bußweiler - Initial contribution, Dennis Nobel - Added null checks
  • Method Details

    • create

      public static ThingStatusInfoBuilder create(ThingStatus status, ThingStatusDetail statusDetail)
      Creates a status info builder for the given status and detail.
      Parameters:
      status - the status (must not be null)
      statusDetail - the detail of the status (must not be null)
      Returns:
      status info builder
    • create

      public static ThingStatusInfoBuilder create(ThingStatus status)
      Creates a status info builder for the given status.
      Parameters:
      status - the status (must not be null)
      Returns:
      status info builder
    • withDescription

      public ThingStatusInfoBuilder withDescription(@Nullable String description)
      Appends a description to the status to build.
      Parameters:
      description - the description
      Returns:
      status info builder
    • withStatusDetail

      public ThingStatusInfoBuilder withStatusDetail(ThingStatusDetail statusDetail)
      Appends a status detail to the status to build.
      Parameters:
      statusDetail - the status detail (must not be null)
      Returns:
      status info builder
    • build

      public ThingStatusInfo build()
      Builds and returns the status info.
      Returns:
      status info