Class SelectorOptions<T>

    • Constructor Detail

      • SelectorOptions

        public SelectorOptions​(ObjectSelector selector,
                               T options)
      • SelectorOptions

        public SelectorOptions​(T options)
      • SelectorOptions

        public SelectorOptions​(@NotNull
                               @NotNull SelectorOptions<T> prototype)
    • Method Detail

      • getOptions

        public T getOptions()
      • findRootOptions

        public static <T> T findRootOptions​(Collection<SelectorOptions<T>> options)
        Returns options that apply to the "root" object. I.e. options that have null selector, null path, empty path, ... Must return 'live object' that could be modified.
      • findOptionsForPath

        @NotNull
        public static <T> @NotNull Collection<T> findOptionsForPath​(Collection<SelectorOptions<T>> options,
                                                                    @NotNull
                                                                    @NotNull UniformItemPath path)
        Finds all the options for given path. TODO could there be more than one? Returns live objects that could be modified by client.
      • isRoot

        public boolean isRoot()
      • isRetrievedFullyByDefault

        public static boolean isRetrievedFullyByDefault​(Class<?> objectType)
      • hasToIncludePath

        public static boolean hasToIncludePath​(@NotNull
                                               @NotNull ItemPath path,
                                               @Nullable
                                               @Nullable Collection<SelectorOptions<GetOperationOptions>> options,
                                               boolean defaultValue)
        Returns true if the asked path must be included in the object based on the provided get options. See GetOperationOptions.retrieve javadoc for more details. Retrieve option with null or empty path asks to load everything. This is not used only in repository but also for retrieving information during provisioning. Default value must be explicitly provided as it depends on the context of the question. Simplified example: When we ask for path "x/y", the path itself and anything under it is to be included. User wants "x/y", as well as "x/y/ya", etc. User does not say anything about path "x" (prefix) or "z" (different path altogether). If no option defines what to do with the asked path, defaultValue is returned.
      • hasToFetchPathNotRetrievedByDefault

        public static boolean hasToFetchPathNotRetrievedByDefault​(@NotNull
                                                                  @NotNull ItemPath path,
                                                                  @Nullable
                                                                  @Nullable Collection<SelectorOptions<GetOperationOptions>> options)
        Returns true if the asked path must be considered for fetching based on the provided get options. This is different from hasToIncludePath(ItemPath, Collection, boolean) as it considers path relation in any direction (subpath or prefix or equal). This is typical for repository usage that asks questions like: "Should I load container x *that I don't fetch by default*?" When the user specifies options with retrieve of the path inside that container, e.g. "x/a"), he does not state that he wants to fetch "x", but the repo can't just ignore processing of "x" and skip it altogether if it is stored separately. At the same time, original semantics of hasToIncludePath(ItemPath, Collection, boolean) has to hold as well - if user asks to load "a", repo needs to fetch "a/b" as well (everything under "a"). Simplified example: When we ask for path "x/y", the path itself, any subpath and any prefix must be considered for fetching. User wants "x/y", as well as "x/y/ya", etc. User does not say anything about path "x" (prefix) or "z" (different path altogether), but while we can ignore "z", we must consider "x" if the repo does not provide it by default. In that case it needs to fetch it (fully or partially, whatever is practical and/or efficient) to provide the requested "x/y" content.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • shortDump

        public void shortDump​(StringBuilder sb)
        Description copied from interface: ShortDumpable
        Show the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.
        Specified by:
        shortDump in interface ShortDumpable
        Parameters:
        sb - StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.