Interface QueryParamEnum

All Superinterfaces:
FriendlyEnum
All Known Implementing Classes:
WPQueryParam

public non-sealed interface QueryParamEnum extends FriendlyEnum
QueryParamEnum is an interface that promotes a unified type for query parameters and a value() method to ensure consistency with the design practices of the project. It can be used as a means to provide your own query parameters to the WPCacheManager safely.
Author:
Yoham Gabriel B. @YGBStudio
See Also:
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <E extends QueryParamEnum>
    @NotNull String
    joinQueryParams(@NotNull Map<E,String> wpRestQueriesMap)
    This method helps you join a map of query parameters into a string that can be used as a query string.

    Methods inherited from interface net.ygbstudio.powerwp4j.base.extension.enums.FriendlyEnum

    value
  • Method Details

    • joinQueryParams

      @NotNull static <E extends QueryParamEnum> @NotNull String joinQueryParams(@NotNull @NotNull Map<E,String> wpRestQueriesMap)
      This method helps you join a map of query parameters into a string that can be used as a query string.

      It is up to you to create a separate class that contains such "leading" parameters or use the same for all as long as both implement QueryParamEnum. In either case this method will help you and throw an IllegalArgumentException if you do not provide any query parameters.

      Type Parameters:
      E - the query parameter enum type
      Parameters:
      wpRestQueriesMap - map of query parameters and their values
      Returns:
      string that can be used as a query string