Package de.xima.fc.gui.common.model.file
Class TextFileSystemViewCrudMapAdapter.Builder<Entry>
- java.lang.Object
-
- de.xima.fc.gui.common.model.file.TextFileSystemViewCrudMapAdapter.Builder<Entry>
-
- Type Parameters:
Entry
- The type of the file system entry.
- Enclosing class:
- TextFileSystemViewCrudMapAdapter<Entry>
public static final class TextFileSystemViewCrudMapAdapter.Builder<Entry> extends Object
Builder for aTextFileSystemViewCrudMapAdapter
.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CrudMapAdapter<String,String>
build()
Creates a newCrudMapAdapter
that uses the configuredICommonFileSystem
to read and write file text content.Map<String,String>
buildMap()
Shortcut for building theCrudMapAdapter
and creating a newCrudMap
with that adapter.TextFileSystemViewCrudMapAdapter.Builder<Entry>
charset(Charset charset)
Sets the charset to use for encoding and decoding the binary data to / from strings.TextFileSystemViewCrudMapAdapter.Builder<Entry>
fileSystem(ICommonFileSystem<Entry> fileSystem)
Sets the file system with the text files.
-
-
-
Method Detail
-
build
public CrudMapAdapter<String,String> build()
Creates a newCrudMapAdapter
that uses the configuredICommonFileSystem
to read and write file text content. The map key is the file ID (as returned by the configured entry encoder), the map value is the file's text content. Uses the configured charset to encode and decode the binary data to/ from strings.Subsequent changes to the builder will not affect the returned
CrudMapAdapter
.- Returns:
- The new
CrudMapAdapter
.
-
buildMap
public Map<String,String> buildMap()
Shortcut for building theCrudMapAdapter
and creating a newCrudMap
with that adapter.Uses the configured
ICommonFileSystem
to read and write file text content. The map key is the file ID (as returned by the configured entry encoder), the map value is the file's text content. Uses the configured charset to encode and decode the binary data to/ from strings.Subsequent changes to the builder will not affect the returned
CrudMapAdapter
.- Returns:
- A new map using the built
CrudMapAdapter
.
-
charset
public TextFileSystemViewCrudMapAdapter.Builder<Entry> charset(Charset charset)
Sets the charset to use for encoding and decoding the binary data to / from strings. If not set, UTF-8 will be used.- Parameters:
charset
- The charset to use.- Returns:
- This builder for chaining calls.
-
fileSystem
public TextFileSystemViewCrudMapAdapter.Builder<Entry> fileSystem(ICommonFileSystem<Entry> fileSystem)
Sets the file system with the text files. If not set, the map will be empty and cannot be filled.- Parameters:
fileSystem
- The content view.- Returns:
- This builder for chaining calls.
-
-