Class BuildStepBuilder

java.lang.Object
io.quarkus.builder.BuildStepBuilder

public final class BuildStepBuilder extends Object
A builder for build step instances within a chain. A build step can consume and produce items. It may also register a destructor for items it produces, which will be run (in indeterminate order) at the end of processing.
  • Constructor Details

  • Method Details

    • setBuildStep

      public BuildStepBuilder setBuildStep(BuildStep buildStep)
      Set the build step for this builder. If no build step is specified, then this step will be excluded from the final chain.
      Parameters:
      buildStep - the build step
      Returns:
      this builder
    • beforeConsume

      public BuildStepBuilder beforeConsume(Class<? extends BuildItem> type)
      This build step should complete before any build steps which consume the given item type are initiated. If no such build steps exist, no ordering constraint is enacted.
      Parameters:
      type - the item type (must not be null)
      Returns:
      this builder
    • beforeConsume

      public BuildStepBuilder beforeConsume(Class<? extends BuildItem> type, ProduceFlag flag)
      This build step should complete before any build steps which consume the given item type are initiated. If no such build steps exist, no ordering constraint is enacted.
      Parameters:
      type - the item type (must not be null)
      flag - the producer flag to apply (must not be null)
      Returns:
      this builder
    • afterProduce

      public BuildStepBuilder afterProduce(Class<? extends BuildItem> type)
      This build step should be initiated after any build steps which produce the given item type are completed. If no such build steps exist, no ordering constraint is enacted.
      Parameters:
      type - the item type (must not be null)
      Returns:
      this builder
    • produces

      public BuildStepBuilder produces(Class<? extends BuildItem> type)
      Similarly to beforeConsume(Class), establish that this build step must come before the consumer(s) of the given item type; however, only one producer may exist for the given item. In addition, the build step may produce an actual value for this item, which will be shared to all consumers during deployment.
      Parameters:
      type - the item type (must not be null)
      Returns:
      this builder
    • produces

      public BuildStepBuilder produces(Class<? extends BuildItem> type, ProduceFlag flag)
      Similarly to beforeConsume(Class), establish that this build step must come before the consumer(s) of the given item type; however, only one producer may exist for the given item. In addition, the build step may produce an actual value for this item, which will be shared to all consumers during deployment.
      Parameters:
      type - the item type (must not be null)
      flag - the producer flag to apply (must not be null)
      Returns:
      this builder
    • produces

      public BuildStepBuilder produces(Class<? extends BuildItem> type, ProduceFlag flag1, ProduceFlag flag2)
      Similarly to beforeConsume(Class), establish that this build step must come before the consumer(s) of the given item type; however, only one producer may exist for the given item. In addition, the build step may produce an actual value for this item, which will be shared to all consumers during deployment.
      Parameters:
      type - the item type (must not be null)
      flag1 - the first producer flag to apply (must not be null)
      flag2 - the second producer flag to apply (must not be null)
      Returns:
      this builder
    • produces

      public BuildStepBuilder produces(Class<? extends BuildItem> type, ProduceFlags flags)
      Similarly to beforeConsume(Class), establish that this build step must come before the consumer(s) of the given item type; however, only one producer may exist for the given item. In addition, the build step may produce an actual value for this item, which will be shared to all consumers during deployment.
      Parameters:
      type - the item type (must not be null)
      flags - the producer flag to apply (must not be null)
      Returns:
      this builder
    • consumes

      public BuildStepBuilder consumes(Class<? extends BuildItem> type)
      This build step consumes the given produced item. The item must be produced somewhere in the chain. If no such producer exists, the chain will not be constructed; instead, an error will be raised.
      Parameters:
      type - the item type (must not be null)
      Returns:
      this builder
    • consumes

      public BuildStepBuilder consumes(Class<? extends BuildItem> type, ConsumeFlags flags)
      This build step consumes the given produced item. The item must be produced somewhere in the chain. If no such producer exists, the chain will not be constructed; instead, an error will be raised.
      Parameters:
      type - the item type (must not be null)
      flags - a set of flags which modify the consume operation (must not be null)
      Returns:
      this builder
    • build

      public BuildChainBuilder build()
      Build this step into the chain.
      Returns:
      the chain builder that this step was added to
    • buildIf

      public BuildChainBuilder buildIf(BooleanSupplier supp)
      Build this step into the chain if the supplier returns true.
      Parameters:
      supp - the boolean supplier (must not be null)
      Returns:
      the chain builder that this step was added to, or null if it was not added
    • getBuildStep

      BuildStep getBuildStep()
    • getConsumes

      Map<ItemId,Consume> getConsumes()
    • getProduces

      Map<ItemId,Produce> getProduces()
    • getRealConsumes

      Set<ItemId> getRealConsumes()
    • getRealProduces

      Set<ItemId> getRealProduces()
    • toString

      public String toString()
      Overrides:
      toString in class Object