Module org.eclipse.jgit
Class OpenSshConfigFile.HostEntry
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.ssh.OpenSshConfigFile.HostEntry
-
- All Implemented Interfaces:
SshConfigStore.HostConfig
- Enclosing class:
- OpenSshConfigFile
public static class OpenSshConfigFile.HostEntry extends Object implements SshConfigStore.HostConfig
A host entry from the ssh config file. Any merging of global values and of several matching host entries, %-substitutions, and ~ replacement have all been done.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,List<String>>getMultiValuedOptions()Retrieves an unmodifiable map of all multi-valued options, with case-insensitive lookup by keys.Map<String,String>getOptions()Retrieves an unmodifiable map of all single-valued options, with case-insensitive lookup by keys.StringgetValue(String key)Retrieves the value of a single-valued key, or the first if the key has multiple values.List<String>getValues(String key)Retrieves the values of a multi or list-valued key.static booleanisListKey(String key)Does the key take a whitespace-separated list of values?voidsetValue(String key, String value)Sets the value of a single-valued key if it not set yet, or adds a value to a multi-valued key.voidsetValue(String key, List<String> values)Sets the values of a multi- or list-valued key.StringtoString()
-
-
-
Method Detail
-
getValue
public String getValue(String key)
Retrieves the value of a single-valued key, or the first if the key has multiple values. Keys are case-insensitive, sogetValue("HostName") == getValue("HOSTNAME").- Specified by:
getValuein interfaceSshConfigStore.HostConfig- Parameters:
key- to get the value of- Returns:
- the value, or
nullif none
-
getValues
public List<String> getValues(String key)
Retrieves the values of a multi or list-valued key. Keys are case-insensitive, sogetValue("HostName") == getValue("HOSTNAME").- Specified by:
getValuesin interfaceSshConfigStore.HostConfig- Parameters:
key- to get the values of- Returns:
- a possibly empty list of values
-
setValue
public void setValue(String key, String value)
Sets the value of a single-valued key if it not set yet, or adds a value to a multi-valued key. If the value isnull, the key is removed altogether, whether it is single-, list-, or multi-valued.- Parameters:
key- to modifyvalue- to set or add
-
setValue
public void setValue(String key, List<String> values)
Sets the values of a multi- or list-valued key.- Parameters:
key- to setvalues- a non-empty list of values
-
isListKey
public static boolean isListKey(String key)
Does the key take a whitespace-separated list of values?- Parameters:
key- to check- Returns:
trueif the key is a list-valued key.
-
getOptions
@NonNull public Map<String,String> getOptions()
Retrieves an unmodifiable map of all single-valued options, with case-insensitive lookup by keys.- Specified by:
getOptionsin interfaceSshConfigStore.HostConfig- Returns:
- all single-valued options
-
getMultiValuedOptions
@NonNull public Map<String,List<String>> getMultiValuedOptions()
Retrieves an unmodifiable map of all multi-valued options, with case-insensitive lookup by keys.- Specified by:
getMultiValuedOptionsin interfaceSshConfigStore.HostConfig- Returns:
- all multi-valued options
-
-