Class Docs
java.lang.Object
io.nosqlbench.nb.api.docsapi.Docs
- All Implemented Interfaces:
DocsBinder,Iterable<DocsNameSpace>
The Docs class is a utility class that makes it easy to enumerate docs for a component.
The primary info type which is used by the doc system is the DocsBinder.
A DocsBinder contains zero or more
DocsNameSpace. A DocsNameSpace has a name,
a set of paths, and a flag that sets it enabled or disabled by default.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContentsOf(Path root) Add each contained path within the specified directory path.addFirstFoundContentPath(String... potentials) addFirstFoundPath(String... potentials) static DocsBinderempty()static DocsBindergetPaths()iterator()merge(DocsBinder other) The result of merging two DocsInfo elements together is a combined DocsInfo element with all unique namespaces occurring exactly once, and with the other namespace overwriting same-named namespaces in the original element.merge(DocsNameSpace namespace) The result of merging a DocPathInfo entry into a DocsInfo element is the combined DocsInfo element with the added entry overwriting any namespace of the same name.The result of removing a set of namespaces from a DocsInfo element is a new DocsInfo element containing only the namespaces which were removed.setEnabledByDefault(boolean enabledByDefault) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Docs
public Docs()
-
-
Method Details
-
forRoot
-
empty
-
namespace
-
addFirstFoundContentPath
-
addFirstFoundPath
-
addContentsOf
Add each contained path within the specified directory path. Only the top-level elements are added. This serves to relativize any content added this way so that the owning directory is not included itself by name.- Parameters:
root- The root of the content to add.- Returns:
- this Docs, for method chaining
-
addPath
-
setEnabledByDefault
-
merge
Description copied from interface:DocsBinderThe result of merging two DocsInfo elements together is a combined DocsInfo element with all unique namespaces occurring exactly once, and with the other namespace overwriting same-named namespaces in the original element.- Specified by:
mergein interfaceDocsBinder- Parameters:
other- The DocsInfo containing namespaces to overlay into this DocsInfo- Returns:
-
merge
Description copied from interface:DocsBinderThe result of merging a DocPathInfo entry into a DocsInfo element is the combined DocsInfo element with the added entry overwriting any namespace of the same name.- Specified by:
mergein interfaceDocsBinder- Parameters:
namespace- The namespace entry to overlay into this DocsInfo- Returns:
-
getPaths
- Specified by:
getPathsin interfaceDocsBinder- Returns:
- All paths in all namespaces are returned, in no guaranteed order.
-
getPathMap
- Specified by:
getPathMapin interfaceDocsBinder- Returns:
- A map of all namespaces to each set of provided paths is returned.
-
getNamespaces
- Specified by:
getNamespacesin interfaceDocsBinder
-
iterator
- Specified by:
iteratorin interfaceIterable<DocsNameSpace>
-
getPathMaps
-
asDocsBinder
-
remove
Description copied from interface:DocsBinderThe result of removing a set of namespaces from a DocsInfo element is a new DocsInfo element containing only the namespaces which were removed. The original DocsInfo element is modified statefully in this case. It is not an error to remove namespaces which are not present in the original DocsInfo. If this condition is important, check for it manually.- Specified by:
removein interfaceDocsBinder- Parameters:
namespaces- The names of the namespaces to remove, should they be present.- Returns:
- A new DocsInfo object representing what was actually removed.
-