Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getResource

        public java.util.Optional<R> getResource()
        Get the selected resource if there was one.
        Returns:
        The resource wrapped in an Optional or Optional.empty()
      • getRationale

        public java.util.Optional<java.lang.String> getRationale()
        Get the rationale for the selection decision.
        Returns:
        The rationale wrapped in an Optional or Optional.empty()