Class MultiFileBuilderParametersImpl

    • Field Detail

      • PARAM_KEY

        private static final java.lang.String PARAM_KEY
        Constant for the key in the parameters map used by this class.
      • managedBuilderParameters

        private BuilderParameters managedBuilderParameters
        The parameters object for managed builders.
      • filePattern

        private java.lang.String filePattern
        The file pattern.
    • Constructor Detail

      • MultiFileBuilderParametersImpl

        public MultiFileBuilderParametersImpl()
    • Method Detail

      • fromParameters

        public static MultiFileBuilderParametersImpl fromParameters​(java.util.Map<java.lang.String,​java.lang.Object> params)
        Obtains an instance of this class from the given map with parameters. If this map does not contain an instance, result is null. This is equivalent to fromParameters(params, false).
        Parameters:
        params - the map with parameters (must not be null)
        Returns:
        an instance of this class fetched from the map or null
        Throws:
        java.lang.NullPointerException - if the map with parameters is null
      • fromParameters

        public static MultiFileBuilderParametersImpl fromParameters​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                                                    boolean createIfMissing)
        Obtains an instance of this class from the given map with parameters and creates a new object if such an instance cannot be found. This method can be used to obtain an instance from a map which has been created using the getParameters() method. If the map does not contain an instance under the expected key and the createIfMissing parameter is true, a new instance is created. Otherwise, result is null.
        Parameters:
        params - the map with parameters (must not be null)
        createIfMissing - a flag whether a new instance should be created if necessary
        Returns:
        an instance of this class fetched from the map or null
        Throws:
        java.lang.NullPointerException - if the map with parameters is null
      • clone

        public MultiFileBuilderParametersImpl clone()
        Clones this object. This is useful because multiple builder instances may use a similar set of parameters. However, single instances of parameter objects must not assigned to multiple builders. Therefore, cloning a parameters object provides a solution for this use case. This method creates a new parameters object with the same content as this one. The internal map storing the parameter values is cloned, too, also collection structures contained in this map. However, no a full deep clone operation is performed. Objects like a ConfigurationInterpolator or Lookups are shared between this and the newly created instance. This implementation also tries to clone the parameters object for managed builders if possible.
        Overrides:
        clone in class BasicBuilderParameters
        Returns:
        a clone of this object
      • getFilePattern

        public java.lang.String getFilePattern()
        Gets the pattern for determining file names for managed configurations.
        Returns:
        the file pattern
      • getManagedBuilderParameters

        public BuilderParameters getManagedBuilderParameters()
        Gets the parameters object for managed configuration builders.
        Returns:
        the parameters for sub configurations
      • getParameters

        public java.util.Map<java.lang.String,​java.lang.Object> getParameters()
        Gets a map with all parameters defined by this objects. The keys of the map correspond to concrete properties supported by the Configuration implementation class the builder produces. The values are the corresponding property values. The return value must not be null. This implementation returns a copy of the internal parameters map with the values set so far. Collection structures (e.g. for lookup objects) are stored as defensive copies, so the original data cannot be modified. This implementation puts a reference to this object under a reserved key in the resulting parameters map.
        Specified by:
        getParameters in interface BuilderParameters
        Overrides:
        getParameters in class BasicBuilderParameters
        Returns:
        a map with builder parameters