Class RealizedStep
- All Implemented Interfaces:
AutoCloseable
A Step
that has been realized, such that it has produced valid output. A RealizedStep
is a linked
traversable DAG in itself, and so is a sort of realized Pipeline
whose outputs can be used.
TODO make this closable?
-
Constructor Summary
ConstructorDescriptionRealizedStep
(@NonNull NamedStep step, @NonNull ResultOrProblems<? extends Realized> result, @NonNull Map<String, List<?>> boundParameters, @NonNull List<RealizedStep> dependencies, @NonNull Struct produces) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDependent
(RealizedStep dependent) protected boolean
void
close()
static RealizedStep
emptyInput
(String name, Struct type) boolean
The complete set ofParameter
s that were used to realize this step.@NonNull List<RealizedStep>
The complete set ofRealizedStep
s that were used to realize this stepThe set ofRealizedStep
s that depend on the output of thisRealizedStep
.@NonNull Struct
getRealized
(Class<T> stepType) Returns the realized result of this step, cast to a given type.@NonNull ResultOrProblems<? extends Realized>
The output of the step.@NonNull NamedStep
getStep()
TheStep
that produced a realized output that went in to thisRealizedStep
boolean
boolean
int
hashCode()
boolean
boolean
boolean
boolean
isFailed()
toString()
-
Constructor Details
-
RealizedStep
public RealizedStep(@NonNull @NonNull NamedStep step, @NonNull @NonNull ResultOrProblems<? extends Realized> result, @NonNull @NonNull Map<String, List<?>> boundParameters, @NonNull @NonNull List<RealizedStep> dependencies, @NonNull @NonNull Struct produces)
-
-
Method Details
-
emptyInput
- Returns:
- a RealizedStep useful for testing scenarios where you want to test realization of some pipeline bits appended to something
-
addDependent
- See Also:
-
hasDependents
public boolean hasDependents()- Returns:
- true if there are steps in the pipeline that directly depend on this step
-
hasNoDependents
public boolean hasNoDependents() -
isFailed
public boolean isFailed()- Returns:
- true if this step or a dependency failed
-
isDirectlyFailed
public boolean isDirectlyFailed()- Returns:
- true if this step failed, but not if that failure was because of a dependency
-
hasDependencies
public boolean hasDependencies()- Returns:
- true if this step has any direct dependencies
-
hasNoDependencies
public boolean hasNoDependencies()- Returns:
- false if this step has any direct dependenices
-
getStepName
-
toString
-
getFailureProblem
- Returns:
- a composite problem for all errors associated with realizing this step, or empty if there were no errors
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getStepType
-
getRealized
Returns the realized result of this step, cast to a given type. Mostly useful for internal workings where the step is assumed to be of a specific type, as it deals in
Optional
s, notResultOrProblems
- Parameters:
stepType
- The type of the result- Returns:
- The realized result, or
empty
if this step failed to realize, or if the step isn't of the given step type
-
getProblems
- Returns:
- a list of problems from the attempt to realize this step, or an empty list if it didn't have problems during realization
-
getStep
The
Step
that produced a realized output that went in to thisRealizedStep
-
getResult
The output of the step. TODO drop the
ResultOrProblems
? -
getBoundParameters
The complete set of
Parameter
s that were used to realize this step. -
getDependencies
The complete set of
RealizedStep
s that were used to realize this step -
getProduces
-
getDependents
The set of
RealizedStep
s that depend on the output of thisRealizedStep
. These are set as a Pipeline is realized, and so is only complete once a pipeline has been fully realized. -
equals
-
canEqual
-
hashCode
public int hashCode()
-