Class ResourceSelectionResult.Builder<R>

  • Type Parameters:
    R - The type of the selected resource
    Enclosing class:
    ResourceSelectionResult<R>

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

      • Builder

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

      • 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
                                                                         java.lang.String selectionRationale)
        Set the rationale for why a resource as or wasn't selected.
        Parameters:
        selectionRationale - The rational or null
        Returns:
        the builder instance