public abstract static class Entry.AbstractEntryBuilder<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Entry.AbstractEntryBuilder.Result<T> |
Modifier and Type | Field and Description |
---|---|
protected SshdConfigFileCursor |
cursor |
protected SshdConfigFile |
file |
protected int |
pointer |
Constructor and Description |
---|
AbstractEntryBuilder() |
Modifier and Type | Method and Description |
---|---|
T |
addBeginingComment(FileEntryType.CommentEntry commentEntry)
Will add a comment entry at the beginning of the section.
|
T |
addComment(String comment)
Will add a comment entry at current location.
|
T |
addCommentForEntry(String key,
FileEntryType.CommentEntry commentEntry)
Will add a comment entry before the entry with the given key.
|
T |
addCommentForEntry(String key,
String comment)
Will add a comment entry before the entry with the given key.
|
T |
addEntry(FileEntryType.SshdConfigFileEntry sshdConfigFileEntry)
Will add entry after last non blank, non comment entry in a section (Global, Match)
Note: Use while operating on file after loading it.
|
T |
appendEntry(FileEntryType.SshdConfigFileEntry sshdConfigFileEntry)
Will add entry to the end of section.
|
SshdConfigFileCursor |
cursor() |
T |
deleteEntry(String key)
Will delete the entry for the given key.
|
Boolean |
entryMatches(String key,
Collection<String> patterns) |
T |
entryMatches(String key,
Collection<String> patterns,
Entry.AbstractEntryBuilder.Result<Boolean> result) |
FileEntryType.SshdConfigFileEntry |
findEntry(String key) |
T |
findEntry(String key,
Entry.AbstractEntryBuilder.Result<FileEntryType.SshdConfigKeyValueEntry> result) |
FileEntryType.SshdConfigFileEntry |
findEntryAtIndex(int index) |
int |
findEntryIndex(String key) |
T |
findEntryIndex(String key,
Entry.AbstractEntryBuilder.Result<Integer> result) |
T |
findEntryToEdit(String key) |
protected abstract Entry |
getManagedInstance() |
T |
resetPointer() |
T |
updateEntry(String key,
String value)
Will update the value for the given key with new entry.
|
protected SshdConfigFileCursor cursor
protected int pointer
protected SshdConfigFile file
protected abstract Entry getManagedInstance()
public T updateEntry(String key, String value)
key
- entry
- public T deleteEntry(String key)
key
- public T addComment(String comment)
commentEntry
- public T addCommentForEntry(String key, String comment)
addCommentForEntry(....1) addCommentForEntry(....2) addCommentForEntry(....3)Above will end up as first 3, then 2 finally 1. All entries are made at index at which the entry is found.
comment
- public T addCommentForEntry(String key, FileEntryType.CommentEntry commentEntry)
addCommentForEntry(....1) addCommentForEntry(....2) addCommentForEntry(....3)Above will end up as first 3, then 2 finally 1. All entries are made at index at which the entry is found.
commentEntry
- public T addBeginingComment(FileEntryType.CommentEntry commentEntry)
addBeginingComment(....1) addBeginingComment(....2) addBeginingComment(....3)Above will end up as first 3, then 2 finally 1. All entries are made at index 0.
commentEntry
- public T addEntry(FileEntryType.SshdConfigFileEntry sshdConfigFileEntry)
sshdConfigFileEntry
- public T appendEntry(FileEntryType.SshdConfigFileEntry sshdConfigFileEntry)
sshdConfigFileEntry
- public FileEntryType.SshdConfigFileEntry findEntry(String key)
public T findEntry(String key, Entry.AbstractEntryBuilder.Result<FileEntryType.SshdConfigKeyValueEntry> result)
public T entryMatches(String key, Collection<String> patterns, Entry.AbstractEntryBuilder.Result<Boolean> result)
public Boolean entryMatches(String key, Collection<String> patterns)
public int findEntryIndex(String key)
public FileEntryType.SshdConfigFileEntry findEntryAtIndex(int index)
public T findEntryIndex(String key, Entry.AbstractEntryBuilder.Result<Integer> result)
public T resetPointer()
public SshdConfigFileCursor cursor()
Copyright © 2024. All rights reserved.