Exemple #1
0
        /// <summary>
        /// Creates a new <see cref="IJenkinsLookup3"/> instance with the specified configuration.
        /// </summary>
        /// <param name="config">Configuration to use when constructing the instance.</param>
        /// <returns>A <see cref="IJenkinsLookup3"/> instance.</returns>
        public IJenkinsLookup3 Create(IJenkinsLookup3Config config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            return(new JenkinsLookup3_Implementation(config));
        }
        public JenkinsLookup3_Implementation(IJenkinsLookup3Config config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            _config = config.Clone();


            if (!_validHashSizes.Contains(_config.HashSizeInBits))
            {
                throw new ArgumentOutOfRangeException($"{nameof(config)}.{nameof(config.HashSizeInBits)}", _config.HashSizeInBits, $"{nameof(config)}.{nameof(config.HashSizeInBits)} must be contained within JenkinsLookup3.ValidHashSizes.");
            }
        }