Mercurial > jhg
comparison src/org/tmatesoft/hg/repo/HgRepoConfig.java @ 333:467fd379b653
Specific accessor that omits predefined entries in the [paths] section
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Wed, 09 Nov 2011 04:56:36 +0100 |
| parents | a37ce7145c3f |
| children | bba9f52cacf3 |
comparison
equal
deleted
inserted
replaced
| 332:72c6eda838a6 | 333:467fd379b653 |
|---|---|
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * @return defined keys, in the order they appear in the section | 114 * @return defined keys, in the order they appear in the section |
| 115 */ | 115 */ |
| 116 public List<String> getKeys() { | 116 public List<String> getKeys() { |
| 117 // PathsSection depends on return value being modifiable | |
| 117 return new ArrayList<String>(config.getSection(section).keySet()); | 118 return new ArrayList<String>(config.getSection(section).keySet()); |
| 118 } | 119 } |
| 119 | 120 |
| 120 /** | 121 /** |
| 121 * Find out whether key is present and got any value | 122 * Find out whether key is present and got any value |
| 169 */ | 170 */ |
| 170 public class PathsSection extends Section { | 171 public class PathsSection extends Section { |
| 171 PathsSection() { | 172 PathsSection() { |
| 172 super("paths"); | 173 super("paths"); |
| 173 } | 174 } |
| 175 | |
| 176 /** | |
| 177 * Similar to {@link #getKeys()}, but without entries for <b>default</b> and <b>default-push</b> paths | |
| 178 * @return list of path symbolic names | |
| 179 */ | |
| 180 public List<String> getPathSymbolicNames() { | |
| 181 final List<String> rv = getKeys(); | |
| 182 rv.remove("default"); | |
| 183 rv.remove("default-push"); | |
| 184 return rv; | |
| 185 } | |
| 174 | 186 |
| 175 public boolean hasDefault() { | 187 public boolean hasDefault() { |
| 176 return isKeySet("default"); | 188 return isKeySet("default"); |
| 177 } | 189 } |
| 178 public String getDefault() { | 190 public String getDefault() { |
