Class Configuration


  • public final class Configuration
    extends java.lang.Object
    Configuration for ApiClientImpls.

    Use Configuration.Builder or the static factory methods to create instances of this class.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Configuration​(java.util.Map<java.lang.String,​java.lang.Object> props)
      Constructor.
    • Constructor Detail

      • Configuration

        protected Configuration​(java.util.Map<java.lang.String,​java.lang.Object> props)
        Constructor.
        Parameters:
        props - configuration properties to be registered with this instance
    • Method Detail

      • properties

        public java.util.Set<java.lang.String> properties()
        Returns the names of all configuration properties registered with this instance.
        Returns:
        set of all registered configuration property names
      • getProperty

        public <T> T getProperty​(java.lang.String propName,
                                 java.lang.Class<T> propClass)
        Get the value of given configuration property.

        The type of the value must be specified, and the returned reference is of that type.

        Parameters:
        propName - name of the property to fetch; must not be null
        propClass - expected type of the property value; must not be null
        Returns:
        value of the property as strongly typed reference or null if no property is registered for propName
        Throws:
        java.lang.ClassCastException - if property is found but its value doesn't match the expected type specified by propClass
      • getAllProperties

        protected java.util.Map<java.lang.String,​java.lang.Object> getAllProperties()
      • newEmptyConfig

        public static Configuration newEmptyConfig()
        Creates a new empty configuration.
        Returns:
        configuration which has no settings
      • newHttpConfig

        public static Configuration newHttpConfig​(HttpConfiguration httpConfig)
        Creates a new configuration instance which holds HTTP settings. This includes TCP timeouts and SSL config.
        Parameters:
        httpConfig - HTTP settings to use
        Returns:
        configuration with the specified HTTP settings
      • newStubConfig

        public static Configuration newStubConfig​(StubConfiguration stubConfig)
        Creates a new configuration instance which holds stub configuration.
        Parameters:
        stubConfig - stub settings to use
        Returns:
        configuration with the specified stub settings