Class ApiConfiguration


  • public final class ApiConfiguration
    extends java.lang.Object
    The configuration to be used with a generated REST API.
    • Method Detail

      • standardConfiguration

        public static ApiConfiguration standardConfiguration()
        Create an ApiConfiguration suitable for generated APIs.
        Returns:
        an ApiConfiguration with additional properties to the base configuration
      • baseConfiguration

        public static ApiConfiguration baseConfiguration()
        Create an ApiConfiguration suitable for custom/hand-written APIs. Populates the configuration with the minimum set of required options
        Returns:
        an ApiConfiguration with standard properties
      • withOption

        public ApiConfiguration withOption​(ApiOption<?> option)
        Add a new option to the configuration (for custom API implementations).
        Parameters:
        option - the option to add
        Returns:
        the ApiConfiguration with the addition of a new option
      • verify

        public VerifyResult verify()
        Verify that all options, that have been set, have valid values.
        Returns:
        A VerifyResult that represents the outcome of verifying all options that have been set.
      • get

        public <T> T get​(ApiOption<T> option)
        Get the value of an option
        Type Parameters:
        T - the type of the option
        Parameters:
        option - the option to fetch
        Returns:
        the associated option value
      • set

        public <T> void set​(ApiOption<T> option,
                            T newValue)
        Set the value of an option
        Type Parameters:
        T - the type of the option
        Parameters:
        option - the option to set
        newValue - the new option value
      • isSet

        public <T> boolean isSet​(ApiOption<T> option)
        Check if an option has an associated value
        Type Parameters:
        T - the type of the option
        Parameters:
        option - the option to check
        Returns:
        true iff there is a value associated with an option
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object