/// <summary>
        /// Add to path.
        /// </summary>
        /// <returns></returns>
        private HierarchyBuilder ByEnvironment()
        {
            var next = new HierarchyBuilder(this);

            next._path = _path.Enqueue(ENV_KEY);
            return(next);
        }
        /// <summary>
        /// Add to path.
        /// </summary>
        /// <returns></returns>
        private HierarchyBuilder ByCustomEnvironmentVariable(string environmentVariable)
        {
            var next = new HierarchyBuilder(this);

            next._path = _path.Enqueue(environmentVariable);
            return(next);
        }
        /// <summary>
        /// Add to path.
        /// </summary>
        /// <returns></returns>
        private HierarchyBuilder ByComponent()
        {
            var next = new HierarchyBuilder(this);

            next._path = _path.Enqueue(COMP_KEY);
            return(next);
        }
        /// <summary>
        /// Add to path.
        /// </summary>
        /// <returns></returns>
        private HierarchyBuilder ByAppName()
        {
            var next = new HierarchyBuilder(this);

            next._path = _path.Enqueue(APP_KEY);
            return(next);
        }
        /// <summary>
        /// Set the root path (within Consul, Consul root should use '/' separator).
        /// Pattern (Root can be used for):
        /// * Tenant isolation (multi-tenant).
        /// * Environments (Prod, Dev, Staging)
        /// * Separate department within a company.
        /// </summary>
        /// <param name="rootPath">
        /// The root path where the configuration start.
        /// for example you can use root per tenant.
        /// </param>
        /// <returns></returns>
        IPermutationRoot IConsulHierarchyBuilder.EntryPath(string rootPath)
        {
            var next = new HierarchyBuilder(this);

            next._root = rootPath;
            return(next);
        }
        /// <summary>
        /// Add to path.
        /// </summary>
        /// <returns></returns>
        private HierarchyBuilder ByNamespace(bool strict)
        {
            var next = new HierarchyBuilder(this);

            next._path     = _path.Enqueue(NS_KEY);
            next._strictNS = strict;
            return(next);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="HierarchyBuilder"/> class.
 /// </summary>
 /// <param name="copyFrom">The copy from.</param>
 private HierarchyBuilder(
     HierarchyBuilder copyFrom)
 {
     _root                  = copyFrom._root;
     _strictNS              = copyFrom._strictNS;
     _path                  = copyFrom._path;
     _applicationName       = copyFrom._applicationName;
     _deploymentEnvironment = copyFrom._deploymentEnvironment;
     _hostEnvironment       = copyFrom._hostEnvironment;
 }