Funcular.IdGenerators.Base36.Base36IdGenerator.ValidateConstructorArguments C# (CSharp) Méthode

ValidateConstructorArguments() private static méthode

private static ValidateConstructorArguments ( int numTimestampCharacters, int numServerCharacters, int numRandomCharacters ) : void
numTimestampCharacters int
numServerCharacters int
numRandomCharacters int
Résultat void
        private static void ValidateConstructorArguments(int numTimestampCharacters, int numServerCharacters, int numRandomCharacters)
        {
            if (numTimestampCharacters > 12)
                throw new ArgumentOutOfRangeException(nameof(numTimestampCharacters), "The maximum characters in any component is 12.");
            if (numServerCharacters > 12)
                throw new ArgumentOutOfRangeException(nameof(numServerCharacters), "The maximum characters in any component is 12.");
            if (numRandomCharacters > 12)
                throw new ArgumentOutOfRangeException(nameof(numRandomCharacters), "The maximum characters in any component is 12.");

            if (numTimestampCharacters < 0)
                throw new ArgumentOutOfRangeException(nameof(numTimestampCharacters), "Number must not be negative.");
            if (numServerCharacters < 0)
                throw new ArgumentOutOfRangeException(nameof(numServerCharacters), "Number must not be negative.");
            if (numRandomCharacters < 0)
                throw new ArgumentOutOfRangeException(nameof(numRandomCharacters), "Number must not be negative.");
        }