Package io.quarkus.builder
Class BuildResult
- java.lang.Object
-
- io.quarkus.builder.BuildResult
-
public final class BuildResult extends Object
The final result of a successful deployment operation.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description BuildResult(ConcurrentHashMap<ItemId,BuildItem> simpleItems, ConcurrentHashMap<ItemId,List<BuildItem>> multiItems, Set<ItemId> finalIds, List<Diagnostic> diagnostics, long nanos, BuildMetrics metrics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAll()Close all the resultant resources, logging any failures.<T extends SimpleBuildItem>
Tconsume(Class<T> type)Consume the value produced for the named item.<T extends MultiBuildItem>
List<T>consumeMulti(Class<T> type)Consume all the values produced for the named item.<T extends SimpleBuildItem>
TconsumeOptional(Class<T> type)Consume the value produced for the named item.List<Diagnostic>getDiagnostics()Get the diagnostics reported during build.longgetDuration(TimeUnit timeUnit)Get the amount of elapsed time from the time the operation was initiated to the time it was completed.BuildMetricsgetMetrics()
-
-
-
Constructor Detail
-
BuildResult
BuildResult(ConcurrentHashMap<ItemId,BuildItem> simpleItems, ConcurrentHashMap<ItemId,List<BuildItem>> multiItems, Set<ItemId> finalIds, List<Diagnostic> diagnostics, long nanos, BuildMetrics metrics)
-
-
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 benull)- Returns:
- the produced item (may be
null) - Throws:
IllegalArgumentException- if this deployer was not declared to consumetype, or iftypeisnullClassCastException- 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 benull)- Returns:
- the produced item (may be
null) - Throws:
ClassCastException- if the cast failed
-
consumeMulti
public <T extends MultiBuildItem> List<T> consumeMulti(Class<T> type)
Consume all the values produced for the named item.- Parameters:
type- the item element type (must not benull)- Returns:
- the produced items (may be empty, will not be
null) - Throws:
IllegalArgumentException- if this deployer was not declared to consumetype
-
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
-
closeAll
public void closeAll() throws RuntimeExceptionClose all the resultant resources, logging any failures.- Throws:
RuntimeException
-
-