Class BuildResult


  • public final class BuildResult
    extends Object
    The final result of a successful deployment operation.
    Author:
    David M. Lloyd
    • Method Detail

      • consume

        public <T extends SimpleBuildItem> T consume​(Class<T> type)
        Consume the value produced for the named item.
        Parameters:
        type - the item type (must not be null)
        Returns:
        the produced item (may be null)
        Throws:
        IllegalArgumentException - if this deployer was not declared to consume type, or if type is null
        ClassCastException - if the cast failed
      • consumeOptional

        public <T extends SimpleBuildItem> T consumeOptional​(Class<T> type)
        Consume the value produced for the named item.
        Parameters:
        type - the item type (must not be null)
        Returns:
        the produced item (may be null)
        Throws:
        ClassCastException - if the cast failed
      • consumeMulti

        public <T extends MultiBuildItemList<T> consumeMulti​(Class<T> type)
        Consume all the values produced for the named item.
        Parameters:
        type - the item element type (must not be null)
        Returns:
        the produced items (may be empty, will not be null)
        Throws:
        IllegalArgumentException - if this deployer was not declared to consume type
      • getDiagnostics

        public List<Diagnostic> getDiagnostics()
        Get the diagnostics reported during build.
        Returns:
        the diagnostics reported during build
      • getDuration

        public long getDuration​(TimeUnit timeUnit)
        Get the amount of elapsed time from the time the operation was initiated to the time it was completed.
        Parameters:
        timeUnit - the time unit to return
        Returns:
        the time
      • getMetrics

        public BuildMetrics getMetrics()
        Returns:
        the build metrics