Class ChainedManifestBuilder

java.lang.Object
com.tccc.kos.commons.manifest.chained.ChainedManifestBuilder

public class ChainedManifestBuilder extends Object
Builder to simplify the process of building a ChainedManifest.
Version:
2024-04-10
  • Field Details

  • Constructor Details

    • ChainedManifestBuilder

      public ChainedManifestBuilder()
  • Method Details

    • setNextManifestId

      public ChainedManifestBuilder setNextManifestId(String nextManifestId)
      Set the id of the next manifest in the chain. Every ChainedManifest must reference another manifest until finally reaching a DeviceManifest .
    • setDeviceType

      public void setDeviceType(String deviceType)
      Set the deviceType of the manifest. If set, this must match the deviceType of the underlying DeviceManifest or else the chain is invalid. This does not need to be set. The value in setting this is if the chained manifest will be provided to another upstream process and it requires deviceType information but has no other way to determine it. It is perfectly fine for all chained manifests to have no deviceType set as the entire chain will then have the deviceType specified in the DeviceManifest .
    • setName

      public ChainedManifestBuilder setName(String name)
      Set the name of this manifest. The name is used by ChainedSectionRef to refer to a given manifest in the chain. This will be shared with partners so they can create references to sections in this manifest. Every manifest in a chain must have a unique name.
    • setProperty

      public ChainedManifestBuilder setProperty(String key, String val)
      Add a property to the manifest. Properties are not used by kOS but provides a way to propagate information to upstream tools. These are available for developer use.
    • getProperty

      public String getProperty(String key)
      Return the value of a previously set property.
    • setInstallSummary

      public void setInstallSummary(String summary)
      Set the kos.install.summary . This provides short summary of what the manifest is going to install. This may be displayed during the install process depending on the ui implementation. This should be limited to something short, such as a version string.
    • addInstallDetail

      public void addInstallDetail(String detail)
      Add a kos.install.detail.* property. This can be used to add additional information shown with the install summary, such as information about a single component. Details should be short, but multiple details can be added. There is no guarantee that details will be displayed in the same order they ware added.
    • addSection

      public ChainedManifestBuilder addSection(String section)
      Create a section with the specified name if it doesn't already exist.
    • addArtifact

      public ChainedManifestBuilder addArtifact(String section, BaseManifestArtifact artifact)
      Add an artifact to the named section. Creates the section if needed.
    • build

      public ChainedManifest build()
      Build the ChainedManifest from the current builder state. Once called this will always return the same manifest.
    • getNextManifestId

      public String getNextManifestId()
    • getDeviceType

      public String getDeviceType()
    • getName

      public String getName()