public class StageConfig extends Object
A view into ProjectStage for an active set of configuration items.
| Modifier and Type | Class and Description |
|---|---|
class |
StageConfig.Builder<T> |
static interface |
StageConfig.Converter<T>
Converter capable of converting a native
String value to a specific type. |
static interface |
StageConfig.Resolver<T>
Coercing resolver for a given configuration item.
|
| Constructor and Description |
|---|
StageConfig(ProjectStage stage) |
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Retrieve the name of this stage.
|
boolean |
hasKeyOrSubkeys(String key)
Determine if the specified key or any sub-keys exists.
|
Set<String> |
keys()
Retrieve the set of explicit keys in the stage.
|
StageConfig.Resolver<String> |
resolve(String name)
Obtain a resolver for a given configuration item name.
|
Set<String> |
simpleSubkeys(String prefix)
Retrieve the set of sub-keys that are immediately underneath the specified prefix.
|
public StageConfig(ProjectStage stage)
public StageConfig.Resolver<String> resolve(String name)
While the default resolver is String-based, the resolver
can be used to obtain the configuration value as a different type.
name - The configuration item name.public Set<String> keys()
public Set<String> simpleSubkeys(String prefix)
If, for example, a prefix of swarm.foo.bar is provided as the parameter,
and there exists the following complete keys:
swarm.foo.bar.xswarm.foo.bar.yswarm.foo.bar.zswarm.foo.barbaraThen this method would return simply the set of [x, y, z]
prefix - The prefix to search for.public boolean hasKeyOrSubkeys(String key)
key - The key to test.true if the key or any sub-key exists, otherwise false.public String getName()
Copyright © 2016 JBoss by Red Hat. All rights reserved.