Top Inners Fields Constructors Methods
com.typesafe.config.impl

pack-priv final Class SimpleConfigObject

extends AbstractConfigObject
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.ObjectStreamException, .Serializable, java.math.BigInteger, java.util.AbstractMap, .ArrayList, .Arrays, .Collection, .Collections, .HashMap, .HashSet, .List, .Map, .Set, com.typesafe.config.ConfigException, .ConfigObject, .ConfigOrigin, .ConfigRenderOptions, .ConfigValue

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final String
private static final SimpleConfigObject
private final boolean
private final boolean
private static final long
private final Map<String, AbstractConfigValue>

Constructor Summary

AccessConstructor and Description
pack-priv
SimpleConfigObject(ConfigOrigin origin, Map<String, AbstractConfigValue> value, ResolveStatus status, boolean ignoresFallbacks)

pack-priv

Method Summary

Modifier and TypeMethod and Description
protected AbstractConfigValue
attemptPeekWithPartialResolve(String
key to look up
key
)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.attemptPeekWithPartialResolve.

Look up the key on an only-partially-resolved object, with no transformation or type conversion of any kind; if 'this' is not resolved then try to look up the key anyway if possible.

protected boolean
public boolean
containsKey(Object
key whose presence in this map is to be tested
key
)

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(Object
value whose presence in this map is to be tested
v
)

Implements java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

pack-priv static final SimpleConfigObject
pack-priv static final SimpleConfigObject
pack-priv static final SimpleConfigObject
public Set<Map.Entry<String, ConfigValue>>
entrySet()

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public boolean
equals(Object
object to be compared for equality with this map
other
)

Overrides com.typesafe.config.impl.AbstractConfigValue.equals.

Implements java.util.Map.equals.

Compares the specified object with this map for equality.

public AbstractConfigValue
get(Object
key to look up
key
)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.get.

Implements com.typesafe.config.ConfigObject.get.

Gets a ConfigValue at the given key, or returns null if there is no value.

public boolean
hasDescendant(AbstractConfigValue descendant)

Implements com.typesafe.config.impl.Container.hasDescendant.

Super-expensive full traversal to see if descendant is anywhere underneath this container.

public int
hashCode()

Overrides com.typesafe.config.impl.AbstractConfigValue.hashCode.

Implements java.util.Map.hashCode.

Returns the hash code value for this map.

protected boolean
public boolean
isEmpty()

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

public Set<String>
keySet()

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

private static boolean
private static int
protected SimpleConfigObject
private SimpleConfigObject
private SimpleConfigObject
private SimpleConfigObject
newCopy(ResolveStatus newStatus, ConfigOrigin newOrigin, boolean newIgnoresFallbacks)

protected SimpleConfigObject
pack-priv SimpleConfigObject
relativized(final Path prefix)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.relativized.

This is used when including one file in another; the included file is relativized to the path it's included into in the parent file.

protected void
render(StringBuilder sb, int indent, boolean atRoot, ConfigRenderOptions options)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.render.

public SimpleConfigObject
replaceChild(AbstractConfigValue child, AbstractConfigValue replacement)

Implements com.typesafe.config.impl.Container.replaceChild.

Replace a child of this value.

pack-priv ResolveStatus
pack-priv ResolveResult<? extends AbstractConfigObject>
resolveSubstitutions(ResolveContext
state of the current resolve
context
,
ResolveSource
where to look up values
source
)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.resolveSubstitutions.

Called only by ResolveContext.resolve().

public int
size()

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.

public Map<String, Object>
unwrapped()

Implements com.typesafe.config.ConfigObject.unwrapped, com.typesafe.config.ConfigValue.unwrapped.

Recursively unwraps the object, returning a map from String to whatever plain Java values are unwrapped from the object's values.

public Collection<ConfigValue>
values()

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.

protected SimpleConfigObject
public SimpleConfigObject
withOnlyKey(String
key to keep
key
)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withOnlyKey.

Implements com.typesafe.config.ConfigObject.withOnlyKey.

Clone the object with only the given key (and its children) retained; all sibling keys are removed.

pack-priv SimpleConfigObject
protected SimpleConfigObject
public SimpleConfigObject
withoutKey(String
key to remove
key
)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withoutKey.

Implements com.typesafe.config.ConfigObject.withoutKey.

Clone the object with the given key removed.

pack-priv SimpleConfigObject
public SimpleConfigObject
withValue(String
key to add
key
,
ConfigValue
value at the new key
v
)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withValue.

Implements com.typesafe.config.ConfigObject.withValue.

Returns a ConfigObject based on this one, but with the given key set to the given value.

pack-priv SimpleConfigObject
private Object
Inherited from com.typesafe.config.impl.AbstractConfigObject:
clearconstructDelayedMergemergeOriginsmergeOriginsnewCopypeekAssumingResolvedpeekPathputputAllremovetoConfigtoFallbackValuevalueTypewithFallbackwithOrigin

Field Detail

EMPTY_NAMEback to summary
private static final String EMPTY_NAME
emptyInstanceback to summary
private static final SimpleConfigObject emptyInstance
ignoresFallbacksback to summary
private final boolean ignoresFallbacks
resolvedback to summary
private final boolean resolved
serialVersionUIDback to summary
private static final long serialVersionUID
valueback to summary
private final Map<String, AbstractConfigValue> value

Constructor Detail

SimpleConfigObjectback to summary
pack-priv SimpleConfigObject(ConfigOrigin origin, Map<String, AbstractConfigValue> value, ResolveStatus status, boolean ignoresFallbacks)
SimpleConfigObjectback to summary
pack-priv SimpleConfigObject(ConfigOrigin origin, Map<String, AbstractConfigValue> value)

Method Detail

attemptPeekWithPartialResolveback to summary
protected AbstractConfigValue attemptPeekWithPartialResolve(String key)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.attemptPeekWithPartialResolve.

Doc from com.typesafe.config.impl.AbstractConfigObject.attemptPeekWithPartialResolve.

Look up the key on an only-partially-resolved object, with no transformation or type conversion of any kind; if 'this' is not resolved then try to look up the key anyway if possible.

Parameters
key:String

key to look up

Returns:AbstractConfigValue

the value of the key, or null if known not to exist

Annotations
@Override
canEqualback to summary
protected boolean canEqual(Object other)

Overrides com.typesafe.config.impl.AbstractConfigValue.canEqual.

Annotations
@Override
containsKeyback to summary
public boolean containsKey(Object key)

Implements java.util.Map.containsKey.

Doc from java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

Parameters
key:Object

key whose presence in this map is to be tested

Returns:boolean

true if this map contains a mapping for the specified key

Annotations
@Override
containsValueback to summary
public boolean containsValue(Object v)

Implements java.util.Map.containsValue.

Doc from java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that Objects.equals(value, v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Parameters
v:Object

value whose presence in this map is to be tested

Returns:boolean

true if this map maps one or more keys to the specified value

Annotations
@Override
emptyback to summary
pack-priv static final SimpleConfigObject empty()
emptyback to summary
pack-priv static final SimpleConfigObject empty(ConfigOrigin origin)
emptyMissingback to summary
pack-priv static final SimpleConfigObject emptyMissing(ConfigOrigin baseOrigin)
entrySetback to summary
public Set<Map.Entry<String, ConfigValue>> entrySet()

Implements java.util.Map.entrySet.

Doc from java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<Map.Entry<String, ConfigValue>>

a set view of the mappings contained in this map

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides com.typesafe.config.impl.AbstractConfigValue.equals.

Implements java.util.Map.equals.

Doc from java.util.Map.equals.

Compares the specified object with this map for equality. Returns true if the given object is also a map and the two maps represent the same mappings. More formally, two maps m1 and m2 represent the same mappings if m1.entrySet().equals(m2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.

Parameters
other:Object

object to be compared for equality with this map

Returns:boolean

true if the specified object is equal to this map

Annotations
@Override
getback to summary
public AbstractConfigValue get(Object key)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.get.

Implements com.typesafe.config.ConfigObject.get.

Doc from com.typesafe.config.ConfigObject.get.

Gets a ConfigValue at the given key, or returns null if there is no value. The returned ConfigValue may have ConfigValueType#NULL or any other type, and the passed-in key must be a key in this object (rather than a path expression).

Parameters
key:Object

key to look up

Returns:AbstractConfigValue

the value at the key or null if none

Annotations
@Override
hasDescendantback to summary
public boolean hasDescendant(AbstractConfigValue descendant)

Implements com.typesafe.config.impl.Container.hasDescendant.

Doc from com.typesafe.config.impl.Container.hasDescendant.

Super-expensive full traversal to see if descendant is anywhere underneath this container.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides com.typesafe.config.impl.AbstractConfigValue.hashCode.

Implements java.util.Map.hashCode.

Doc from java.util.Map.hashCode.

Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hash codes of each entry in the map's entrySet() view. This ensures that m1.equals(m2) implies that m1.hashCode()==m2.hashCode() for any two maps m1 and m2, as required by the general contract of Object#hashCode.

Returns:int

the hash code value for this map

Annotations
@Override
ignoresFallbacksback to summary
protected boolean ignoresFallbacks()

Overrides com.typesafe.config.impl.AbstractConfigValue.ignoresFallbacks.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements java.util.Map.isEmpty.

Doc from java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

Returns:boolean

true if this map contains no key-value mappings

Annotations
@Override
keySetback to summary
public Set<String> keySet()

Implements java.util.Map.keySet.

Doc from java.util.Map.keySet.

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Returns:Set<String>

a set view of the keys contained in this map

Annotations
@Override
mapEqualsback to summary
private static boolean mapEquals(Map<String, ConfigValue> a, Map<String, ConfigValue> b)
mapHashback to summary
private static int mapHash(Map<String, ConfigValue> m)
mergedWithObjectback to summary
protected SimpleConfigObject mergedWithObject(AbstractConfigObject abstractFallback)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.mergedWithObject.

Annotations
@Override
modifyback to summary
private SimpleConfigObject modify(AbstractConfigValue.NoExceptionsModifier modifier)
modifyMayThrowback to summary
private SimpleConfigObject modifyMayThrow(AbstractConfigValue.Modifier modifier) throws Exception
newCopyback to summary
private SimpleConfigObject newCopy(ResolveStatus newStatus, ConfigOrigin newOrigin, boolean newIgnoresFallbacks)
newCopyback to summary
protected SimpleConfigObject newCopy(ResolveStatus newStatus, ConfigOrigin newOrigin)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.newCopy.

Annotations
@Override
relativizedback to summary
pack-priv SimpleConfigObject relativized(final Path prefix)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.relativized.

Doc from com.typesafe.config.impl.AbstractConfigValue.relativized.

This is used when including one file in another; the included file is relativized to the path it's included into in the parent file. The point is that if you include a file at foo.bar in the parent, and the included file as a substitution ${a.b.c}, the included substitution now needs to be ${foo.bar.a.b.c} because we resolve substitutions globally only after parsing everything.

Returns:SimpleConfigObject

value relativized to the given path or the same value if nothing to do

Annotations
@Override
renderback to summary
protected void render(StringBuilder sb, int indent, boolean atRoot, ConfigRenderOptions options)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.render.

Annotations
@Override
replaceChildback to summary
public SimpleConfigObject replaceChild(AbstractConfigValue child, AbstractConfigValue replacement)

Implements com.typesafe.config.impl.Container.replaceChild.

Doc from com.typesafe.config.impl.Container.replaceChild.

Replace a child of this value. CAUTION if replacement is null, delete the child, which may also delete the parent, or make the parent into a non-container.

Annotations
@Override
resolveStatusback to summary
pack-priv ResolveStatus resolveStatus()

Overrides com.typesafe.config.impl.AbstractConfigValue.resolveStatus.

Annotations
@Override
resolveSubstitutionsback to summary
pack-priv ResolveResult<? extends AbstractConfigObject> resolveSubstitutions(ResolveContext context, ResolveSource source) throws NotPossibleToResolve

Implements abstract com.typesafe.config.impl.AbstractConfigObject.resolveSubstitutions.

Doc from com.typesafe.config.impl.AbstractConfigValue.resolveSubstitutions.

Called only by ResolveContext.resolve().

Parameters
context:ResolveContext

state of the current resolve

source:ResolveSource

where to look up values

Returns:ResolveResult<? extends AbstractConfigObject>

a new value if there were changes, or this if no changes

Annotations
@Override
sizeback to summary
public int size()

Implements java.util.Map.size.

Doc from java.util.Map.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of key-value mappings in this map

Annotations
@Override
unwrappedback to summary
public Map<String, Object> unwrapped()

Implements com.typesafe.config.ConfigObject.unwrapped, com.typesafe.config.ConfigValue.unwrapped.

Doc from com.typesafe.config.ConfigObject.unwrapped.

Recursively unwraps the object, returning a map from String to whatever plain Java values are unwrapped from the object's values.

Returns:Map<String, Object>

a java.util.Map containing plain Java objects

Annotations
@Override
valuesback to summary
public Collection<ConfigValue> values()

Implements java.util.Map.values.

Doc from java.util.Map.values.

Returns a Collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Collection<ConfigValue>

a collection view of the values contained in this map

Annotations
@Override
withFallbacksIgnoredback to summary
protected SimpleConfigObject withFallbacksIgnored()

Overrides com.typesafe.config.impl.AbstractConfigValue.withFallbacksIgnored.

Annotations
@Override
withOnlyKeyback to summary
public SimpleConfigObject withOnlyKey(String key)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withOnlyKey.

Implements com.typesafe.config.ConfigObject.withOnlyKey.

Doc from com.typesafe.config.ConfigObject.withOnlyKey.

Clone the object with only the given key (and its children) retained; all sibling keys are removed.

Parameters
key:String

key to keep

Returns:SimpleConfigObject

a copy of the object minus all keys except the one specified

Annotations
@Override
withOnlyPathback to summary
pack-priv SimpleConfigObject withOnlyPath(Path path)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withOnlyPath.

Annotations
@Override
withOnlyPathOrNullback to summary
protected SimpleConfigObject withOnlyPathOrNull(Path path)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withOnlyPathOrNull.

Annotations
@Override
withoutKeyback to summary
public SimpleConfigObject withoutKey(String key)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withoutKey.

Implements com.typesafe.config.ConfigObject.withoutKey.

Doc from com.typesafe.config.ConfigObject.withoutKey.

Clone the object with the given key removed.

Parameters
key:String

key to remove

Returns:SimpleConfigObject

a copy of the object minus the specified key

Annotations
@Override
withoutPathback to summary
pack-priv SimpleConfigObject withoutPath(Path path)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withoutPath.

Annotations
@Override
withValueback to summary
public SimpleConfigObject withValue(String key, ConfigValue v)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withValue.

Implements com.typesafe.config.ConfigObject.withValue.

Doc from com.typesafe.config.ConfigObject.withValue.

Returns a ConfigObject based on this one, but with the given key set to the given value. Does not modify this instance (since it's immutable). If the key already has a value, that value is replaced. To remove a value, use ConfigObject#withoutKey(String).

Parameters
key:String

key to add

v:ConfigValue

value at the new key

Returns:SimpleConfigObject

the new instance with the new map entry

Annotations
@Override
withValueback to summary
pack-priv SimpleConfigObject withValue(Path path, ConfigValue v)

Implements abstract com.typesafe.config.impl.AbstractConfigObject.withValue.

Annotations
@Override
writeReplaceback to summary
private Object writeReplace() throws ObjectStreamException
com.typesafe.config.impl back to summary

private final Class SimpleConfigObject.RenderComparator

extends Object
implements Comparator<String>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.util.Comparator

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
compare(String
the first object to be compared.
a
,
String
the second object to be compared.
b
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

RenderComparatorback to summary
private RenderComparator()

Method Detail

compareback to summary
public int compare(String a, String b)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
a:String

the first object to be compared.

b:String

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
isAllDigitsback to summary
private static boolean isAllDigits(String s)
com.typesafe.config.impl back to summary

private final Class SimpleConfigObject.ResolveModifier

extends Object
implements Modifier
Class Inheritance
All Implemented Interfaces
com.typesafe.config.impl.AbstractConfigValue.Modifier

Field Summary

Modifier and TypeField and Description
pack-priv ResolveContext
pack-priv final Path
pack-priv final ResolveSource

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public AbstractConfigValue
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
pack-priv ResolveContext context
originalRestrictback to summary
pack-priv final Path originalRestrict
sourceback to summary
pack-priv final ResolveSource source

Constructor Detail

ResolveModifierback to summary
pack-priv ResolveModifier(ResolveContext context, ResolveSource source)

Method Detail

modifyChildMayThrowback to summary
public AbstractConfigValue modifyChildMayThrow(String key, AbstractConfigValue v) throws NotPossibleToResolve

Implements com.typesafe.config.impl.AbstractConfigValue.Modifier.modifyChildMayThrow.

Annotations
@Override