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
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an unmodifiable map of all multi-valued options, with case-insensitive lookup by keys.Retrieves an unmodifiable map of all single-valued options, with case-insensitive lookup by keys.Retrieves the value of a single-valued key, or the first if the key has multiple values.Retrieves the values of a multi or list-valued key.static boolean
Does the key take a whitespace-separated list of values?void
Sets the value of a single-valued key if it not set yet, or adds a value to a multi-valued key.void
Sets the values of a multi- or list-valued key.toString()
-
Constructor Details
-
HostEntry
public HostEntry()Constructor used to build the merged entry; never matches anything -
HostEntry
- Parameters:
patterns
- to be used in matching against host name.
-
-
Method Details
-
getValue
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:
getValue
in interfaceSshConfigStore.HostConfig
- Parameters:
key
- to get the value of- Returns:
- the value, or
null
if none
-
getValues
Retrieves the values of a multi or list-valued key. Keys are case-insensitive, sogetValue("HostName") == getValue("HOSTNAME")
.- Specified by:
getValues
in interfaceSshConfigStore.HostConfig
- Parameters:
key
- to get the values of- Returns:
- a possibly empty list of values
-
setValue
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
Sets the values of a multi- or list-valued key.- Parameters:
key
- to setvalues
- a non-empty list of values
-
isListKey
Does the key take a whitespace-separated list of values?- Parameters:
key
- to check- Returns:
true
if the key is a list-valued key.
-
getOptions
Retrieves an unmodifiable map of all single-valued options, with case-insensitive lookup by keys.- Specified by:
getOptions
in interfaceSshConfigStore.HostConfig
- Returns:
- all single-valued options
-
getMultiValuedOptions
Retrieves an unmodifiable map of all multi-valued options, with case-insensitive lookup by keys.- Specified by:
getMultiValuedOptions
in interfaceSshConfigStore.HostConfig
- Returns:
- all multi-valued options
-
toString
-