Interface DimensionQueryBuilder


  • public interface DimensionQueryBuilder
    A builder used to configure and build a new DimensionQuery.

    The builder is a throwaway-object; you can only build a single query using the same builder.

    • Method Detail

      • build

        DimensionQuery build()
        Returns a DimensionQuery built from parameters set on this builder.
        Returns:
        a DimensionQuery built from parameters set on this builder
      • rootNodes

        DimensionQueryBuilder rootNodes​(String externalKey)
        Adds a root node for the query.
        Parameters:
        externalKey - external key of the root node to add
        Returns:
        this DimensionQueryBuilder
      • rootNodes

        DimensionQueryBuilder rootNodes​(String... externalKeys)
        Adds multiple root nodes for the query.
        Parameters:
        externalKeys - external keys of the root nodes to add
        Returns:
        this DimensionQueryBuilder
      • rootNodes

        DimensionQueryBuilder rootNodes​(ObjectReference objectReference)
        Adds a root node for the query.
        Parameters:
        objectReference - object reference of the root node to add
        Returns:
        this DimensionQueryBuilder
      • rootNodes

        DimensionQueryBuilder rootNodes​(ObjectReference... objectReferences)
        Adds multiple root nodes for the query.
        Parameters:
        objectReferences - object references of the root nodes to add
        Returns:
        this DimensionQueryBuilder
      • forAttribute

        DimensionQueryBuilder forAttribute​(String externalKey)
        Specifies the dimension attribute that defines the root node of the query.

        This function will look up the dimension attribute specified, and use the dimension(s) specified for that attribute as the root node(s) for the query.

        Parameters:
        externalKey - externalKey of the dimension attribute defining root node(s) for the query
        Returns:
        this DimensionQueryBuilder
      • forAttribute

        DimensionQueryBuilder forAttribute​(ObjectReference objectReference)
        Specifies the dimension attribute that defines the root node of the query.

        This function will look up the dimension attribute specified, and use the dimension(s) specified for that attribute as the root dimension(s) for the query.

        Parameters:
        objectReference - object reference of the dimension attribute defining root node(s) for the query
        Returns:
        this DimensionQueryBuilder
      • levels

        DimensionQueryBuilder levels​(int levels)
        Specifies the number of levels to be returned by the query.

        Note that the limit can be overridden by the ContentQueryRunner, if required. If neither the builder nor the runner specifies the number of levels, the default is all levels.

        Parameters:
        levels - the number of levels to return
        Returns:
        this DimensionQueryBuilder
      • configure

        DimensionQueryBuilder configure​(Consumer<DimensionQueryBuilder> configurator)
        Calls a configuration function with this builder, to allow reusable configuration logic.

        This function calls a separate configurator function with this builder as a parameter. The configurator can then configure this builder as it sees fit. The main use case of this is to include a shared configuration as part of a fluent builder-pattern.

        Parameters:
        configurator - the configurator function
        Returns:
        this DimensionQueryBuilder
      • configure

        <U> DimensionQueryBuilder configure​(BiConsumer<DimensionQueryBuilder,​U> configurator,
                                            U parameter)
        Calls a configuration function with this builder, to allow reusable configuration logic.

        This function calls a separate configurator function with this builder as the first parameter, and a user specified value as the second. The configurator can then configure this builder as it sees fit. The main use case of this is to include a shared configuration as part of a fluent builder-pattern.

        Parameters:
        configurator - the configurator function
        Returns:
        this DimensionQueryBuilder