Module io.github.ascopes.jct
Class JctFileManagerConfigurerChain
java.lang.Object
io.github.ascopes.jct.filemanagers.config.JctFileManagerConfigurerChain
A chain of configurers to apply to a file manager.
While not designed for concurrent use, all operations are shielded by a mutex to guard against potentially confusing behaviour should this component be shared across multiple threads.
- Since:
- 0.0.1
- Author:
- Ashley Scopes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFirst(JctFileManagerConfigurer configurer) Add a configurer to the start of the chain.addLast(JctFileManagerConfigurer configurer) Add a configurer to the end of the chain.configure(JctFileManager fileManager) Apply each configurer to the given file manager in order.list()Get an immutable copy of the list of configurers.
-
Constructor Details
-
JctFileManagerConfigurerChain
public JctFileManagerConfigurerChain()Initialise this chain.
-
-
Method Details
-
addFirst
Add a configurer to the start of the chain.- Parameters:
configurer- the configurer to add.- Returns:
- this chain for further calls.
-
addLast
Add a configurer to the end of the chain.- Parameters:
configurer- the configurer to add.- Returns:
- this chain for further calls.
-
list
Get an immutable copy of the list of configurers.- Returns:
- the list of configurers.
-
configure
Apply each configurer to the given file manager in order.- Parameters:
fileManager- the file manager to configure.- Returns:
- the configured file manager to use. This may or may not be the same object as the input parameter, depending on how the configurers manipulate the input object.
-