Class FirmwareBuilder


  • @NonNullByDefault
    public final class FirmwareBuilder
    extends Object
    The builder to create a Firmware.
    Author:
    Thomas Höfer - Initial contribution, Dimitar Ivanov - Extracted as separate class for Firmware, introduced firmware restriction function
    • Method Detail

      • withVendor

        public FirmwareBuilder withVendor​(@Nullable String vendor)
        Adds the vendor to the builder.
        Parameters:
        vendor - the vendor to be added to the builder (can be null)
        Returns:
        the updated builder
      • withModel

        public FirmwareBuilder withModel​(@Nullable String model)
        Adds the model to the builder.
        Parameters:
        model - the model to be added to the builder (can be null)
        Returns:
        the updated builder
      • withModelRestricted

        public FirmwareBuilder withModelRestricted​(boolean modelRestricted)
        Sets the modelRestricted flag in the builder.
        Parameters:
        modelRestricted - the modelRestricted flag to be added to the builder
        Returns:
        the updated builder
      • withDescription

        public FirmwareBuilder withDescription​(@Nullable String description)
        Adds the description to the builder.
        Parameters:
        description - the description to be added to the builder (can be null)
        Returns:
        the updated builder
      • withPrerequisiteVersion

        public FirmwareBuilder withPrerequisiteVersion​(@Nullable String prerequisiteVersion)
        Adds the prerequisite version to the builder.
        Parameters:
        prerequisiteVersion - the prerequisite version to be added to the builder (can be null)
        Returns:
        the updated builder
      • withChangelog

        public FirmwareBuilder withChangelog​(@Nullable String changelog)
        Adds the changelog to the builder.
        Parameters:
        changelog - the changelog to be added to the builder (can be null)
        Returns:
        the updated builder
      • withOnlineChangelog

        public FirmwareBuilder withOnlineChangelog​(@Nullable URL onlineChangelog)
        Adds the online changelog to the builder.
        Parameters:
        onlineChangelog - the online changelog to be added to the builder (can be null)
        Returns:
        the updated builder
      • withInputStream

        public FirmwareBuilder withInputStream​(@Nullable InputStream inputStream)
        Adds the input stream for the binary content to the builder.
        Parameters:
        inputStream - the input stream for the binary content to be added to the builder (can be null)
        Returns:
        the updated builder
      • withProperties

        public FirmwareBuilder withProperties​(Map<String,​String> properties)
        Adds the properties to the builder.
        Parameters:
        properties - the properties to be added to the builder (not null)
        Returns:
        the updated builder
        Throws:
        IllegalArgumentException - if the given properties are null
      • withMd5Hash

        public FirmwareBuilder withMd5Hash​(@Nullable String md5Hash)
        Adds the given md5 hash value to the builder.
        Parameters:
        md5Hash - the md5 hash value to be added to the builder (can be null)
        Returns:
        the updated builder