.config, .gitconfig, .gitmodules file.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Config.
Converts enumeration values into configuration options and vice-versa, allowing to match a config option with an enum value. |
| public static interface | Config.
type of the application model created by the parser. T>Parses a section of the configuration into an application model object. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Config | |
| private static final TypedConfigGetter | |
| private static final String[] | |
| private final ListenerList | listeners
the change listeners |
| private static final int | |
| private static final String | MISSING_ENTRY
Magic value indicating a missing entry. |
| private final AtomicReference | state
Immutable current state of the configuration data. |
| private static TypedConfigGetter |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ListenerHandle | Returns: the handle to the registered listenerthe listener listener)Adds a listener to be notified about changes. |
| private void | |
| private static <T> T[] | |
| protected void | |
| private static List | |
| pack-priv static String | |
| pack-priv static String | |
| private static int | findSectionEnd(final List<ConfigLine> entries, final String section, final String subsection, boolean skipIncludedLines)
|
| protected void | |
| public void | |
| private List | |
| public < type of configuration model to return. T> T | Returns: the parsed object instance, which is cached inside this config.parser which can create the model if it is not already
available in this configuration file. The parser is also used
as the key into a cache and must obey the hashCode and equals
contract in order to reuse a parsed model. parserObtain a handle to a parsed set of configuration values. |
| public Config | |
| private ConfigSnapshot | |
| public boolean | Returns: true if any value or defaultValue is true, false for missing or explicit falsesection the key is grouped within. section, String name of the key to get. name, boolean default value to return if no value was present. defaultValue)Get a boolean value from the git config |
| public Boolean | Returns: configured boolean value, ornull if not set.section the key is grouped within. section, String name of the key to get. name)Get a boolean value from the git config |
| public boolean | Returns: true if any value or defaultValue is true, false for missing or explicit falsesection the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, boolean default value to return if no value was present. defaultValue)Get a boolean value from the git config |
| public Boolean | Returns: configured boolean value, ornull if not set.section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name)Get a boolean value from the git config |
| public < type of the returned enum T extends Enum | Returns: the selected enumeration value, ordefaultValue.section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, T default value to return if no value was present. defaultValue)Parse an enumeration from the configuration. |
| public < type of the returned enum T extends Enum | Returns: the selected enumeration value, ordefaultValue.all possible values in the enumeration which should be
recognized. Typically all, String EnumType.values().section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, T default value to return if no value was present. defaultValue)
Deprecated
use
getEnum(String, String, String, Enum) or
{getEnum(Enum[], String, String, String)} instead.
Parse an enumeration from the configuration. |
| public < type of the returned enum T extends Enum | Returns: the selected enumeration value, ornull if not set.all possible values in the enumeration which should be
recognized. Typically all, String EnumType.values().section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name)Parse an enumeration from the configuration. |
| public int | |
| public Integer | |
| public int | Returns: an integer value from the configuration, or defaultValue.section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, int default value to return if no value was present. defaultValue)Obtain an integer value from the configuration. |
| public Integer | |
| public int | Returns: an integer value from the configuration, or defaultValue.section the key is grouped within. section, String name of the key to get. name, int minimum value minValue, int maximum value maxValue, int default value to return if no value was present. defaultValue)Obtain an integer value from the configuration which must be inside given range. |
| public Integer | Returns: an integer value from the configuration, ornull if not
set.section the key is grouped within. section, String name of the key to get. name, int minimum value minValue, int maximum value maxValue)Obtain an integer value from the configuration which must be inside given range. |
| public int | Returns: an integer value from the configuration, or defaultValue.section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, int minimum value minValue, int maximum value maxValue, int default value to return if no value was present. defaultValue)Obtain an integer value from the configuration which must be inside given range. |
| public Integer | Returns: an integer value from the configuration, ornull if not
set.section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, int minimum value minValue, int maximum value maxValue)Obtain an integer value from the configuration which must be inside given range. |
| public long | |
| public Long | |
| public long | Returns: an integer value from the configuration, or defaultValue.section the key is grouped within. section, String subsection name, such a remote or branch name. subsection, String name of the key to get. name, long default value to return if no value was present. defaultValue)Obtain an integer value from the configuration. |
| public Long | |
| public Set | |
| public Set | |
| public Set | |
| public Set | |
| public Path | getPath(String
section the key is in. section, String subsection the key is in, or null if not in a subsection. subsection, String the key name. name, FS to use to convert the string into a path. fs, File directory to resolve the path against if it is a relative
path; resolveAgainst, Path null to use the Java process's current
directory.to return if no value was present defaultValue)Parse a string value and treat it as a file path, replacing a ~/ prefix by the user's home directory. |
| private String | |
| private String[] | |
| public List | Returns: a possibly empty list oforg.ssection the key is in. section, String subsection the key is in, or null if not in a subsection. subsection, String the key name. name)Parse a list of |
| public Set | Returns: the sections defined in thisorg..
The set's iterator returns sections in the order they are
declared by the configuration starting from this instance and
progressing through the base.Get the sections defined in this |
| private ConfigSnapshot | |
| public String | |
| public String[] | Returns: array of zero or more values from the configuration.the section section, String the subsection for the value subsection, final String the key name name)Get a list of string values If this instance was created with a base, the base's values are returned first (if any). |
| public Set | Returns: set of all subsections of specified section within this configuration and its base configuration; may be empty if no subsection exists. The set's iterator returns sections in the order they are declared by the configuration starting from this instance and progressing through the base.section to search for. section)Get set of all subsections of specified section within this configuration and its base configuration |
| public long | Returns: the value, ordefaultValue if not set, expressed in
units.section the key is in. section, String subsection the key is in, or null if not in a subsection. subsection, String the key name. name, long default value to return if no value was present. defaultValue, TimeUnit the units of wantUnit)defaultValue and the return value, as
well as the units to assume if the value does not contain an
indication of the units.Parse a numerical time unit, such as "1 minute", from the configuration. |
| public Long | Returns: the value, ornull if not set, expressed in
units.section the key is in. section, String subsection the key is in, or null if not in a subsection. subsection, String the key name. name, TimeUnit the units of wantUnit)defaultValue and the return value, as
well as the units to assume if the value does not contain an
indication of the units.Parse a numerical time unit, such as "1 minute", from the configuration. |
| public static boolean | |
| protected boolean | Returns: true if bytes should be treated as UTF-8, false otherwise.the bytes to check encoding for. bytes)Check if bytes should be treated as UTF-8 or not. |
| private ConfigSnapshot | |
| private ConfigSnapshot | |
| protected boolean | Returns: whether to issue change events for transient changesDetermine whether to issue change events for transient changes. |
| protected byte[] | Returns: the read bytes, or null if the included config should be ignoredpossibly relative path to the included config, as specified in
this config relPath)Read the included config from the specified (possibly) relative path |
| private static String | |
| private static String | |
| private static String | |
| private static String | |
| public boolean | Returns: true if a section was present and was removed;
false if the config was not changed (i.e., no such
section was present)section name, e.g "branch" section, String optional subsection value, e.g. a branch name subsection)Removes all configuration values under a single section. |
| private ConfigSnapshot | replaceStringList(final ConfigSnapshot srcState, final String section, final String subsection, final String name, final List<String> values)
|
| public void | setBoolean(final String
section name, e.g "branch" section, final String optional subsection value, e.g. a branch name subsection, final String parameter name, e.g. "filemode" name, final boolean parameter value value)Add or modify a configuration value. |
| public < type of the enum to set T extends Enum | |
| public void | |
| public void | |
| public void | |
| public void | |
| public static void | setTypedConfigGetter(TypedConfigGetter
to use; if getter)null use the default getter.Globally sets a |
| public String | Returns: this configuration, formatted as a Git style text file.Get this configuration, formatted as a Git style text file. |
| private static String | |
| public void | uncache(Config.
parser used to obtain the configuration object. parserRemove a cached configuration object. |
| public void | |
| public void | unsetSection(String
section name, e.g "branch" section, String optional subsection value, e.g. a branch name subsection)Remove all configuration values under a single section. |
| private ConfigSnapshot |