Package com.netflix.genie.web.scripts
Class ResourceSelectorScriptResult<R>
- java.lang.Object
-
- com.netflix.genie.web.scripts.ResourceSelectorScriptResult<R>
-
- Type Parameters:
R
- The type of resource that was selected
public class ResourceSelectorScriptResult<R> extends java.lang.Object
Class to represent a generic response from a script which selects a resource from a set of resources.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceSelectorScriptResult.Builder<R>
A builder for these the results to prevent scripts from having to redo everything based on constructors if we change parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getRationale()
Get the rationale for the selection decision.java.util.Optional<R>
getResource()
Get the selected resource if there was one.
-
-
-
Method Detail
-
getResource
public java.util.Optional<R> getResource()
Get the selected resource if there was one.- Returns:
- The resource wrapped in an
Optional
orOptional.empty()
-
getRationale
public java.util.Optional<java.lang.String> getRationale()
Get the rationale for the selection decision.- Returns:
- The rationale wrapped in an
Optional
orOptional.empty()
-
-