Class ResourceSelectionResult.Builder<R>

java.lang.Object
com.netflix.genie.web.dtos.ResourceSelectionResult.Builder<R>
Type Parameters:
R - The type of the selected resource
Enclosing class:
ResourceSelectionResult<R>

public static class ResourceSelectionResult.Builder<R> extends Object
A builder for ResourceSelectionResult instances.
Since:
4.0.0
  • Constructor Details

    • Builder

      public Builder(Class<?> selectorClass)
      Constructor.
      Parameters:
      selectorClass - The class that generated this result
  • Method Details

    • withSelectedResource

      public ResourceSelectionResult.Builder<R> withSelectedResource(@Nullable R selectedResource)
      Set the resource that was selected by this selector if any.
      Parameters:
      selectedResource - The selected resource or null
      Returns:
      the builder instance
    • withSelectionRationale

      public ResourceSelectionResult.Builder<R> withSelectionRationale(@Nullable String selectionRationale)
      Set the rationale for why a resource as or wasn't selected.
      Parameters:
      selectionRationale - The rational or null
      Returns:
      the builder instance
    • build

      public ResourceSelectionResult<R> build()
      Build a new immutable ResourceSelectionResult instance out of the current state of this builder.
      Returns:
      A new ResourceSelectionResult instance that is immutable