Top Fields Constructors Methods
com.typesafe.config.impl

pack-priv final Class SimpleConfigOrigin

extends Object
implements ConfigOrigin
Class Inheritance
All Implemented Interfaces
com.typesafe.config.ConfigOrigin
Imports
java.io.File, .IOException, java.net.MalformedURLException, .URL, java.util.ArrayList, .Collection, .Collections, .EnumMap, .Iterator, .List, .Map, com.typesafe.config.ConfigException, .ConfigOrigin, com.typesafe.config.impl.SerializedConfigValue.SerializedField

Field Summary

Modifier and TypeField and Description
private final List<String>
private final String
private final int
private final int
pack-priv static final String
private final OriginType
private final String
private final String

Constructor Summary

AccessConstructor and Description
protected
SimpleConfigOrigin(String description, int lineNumber, int endLineNumber, OriginType originType, String urlOrNull, String resourceOrNull, List<String> commentsOrNull)

Method Summary

Modifier and TypeMethod and Description
pack-priv SimpleConfigOrigin
addURL(URL url)

pack-priv SimpleConfigOrigin
pack-priv static Map<SerializedConfigValue.SerializedField, Object>
public List<String>
comments()

Implements com.typesafe.config.ConfigOrigin.comments.

Returns any comments that appeared to "go with" this place in the file.

public String
description()

Implements com.typesafe.config.ConfigOrigin.description.

Returns a string describing the origin of a value or exception.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

pack-priv static Map<SerializedConfigValue.SerializedField, Object>
public String
filename()

Implements com.typesafe.config.ConfigOrigin.filename.

Returns a filename describing the origin.

pack-priv static SimpleConfigOrigin
pack-priv static SimpleConfigOrigin
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public int
lineNumber()

Implements com.typesafe.config.ConfigOrigin.lineNumber.

Returns a line number where the value or exception originated.

pack-priv static ConfigOrigin
pack-priv static ConfigOrigin
pack-priv static ConfigOrigin
private static SimpleConfigOrigin
private static SimpleConfigOrigin
pack-priv static SimpleConfigOrigin
newEnvVariable(String description)

pack-priv static SimpleConfigOrigin
newFile(String filename)

pack-priv static SimpleConfigOrigin
newResource(String resource, URL url)

pack-priv static SimpleConfigOrigin
newResource(String resource)

pack-priv static SimpleConfigOrigin
newSimple(String description)

pack-priv static SimpleConfigOrigin
newURL(URL url)

pack-priv OriginType
pack-priv SimpleConfigOrigin
public String
resource()

Implements com.typesafe.config.ConfigOrigin.resource.

Returns a classpath resource name describing the origin.

private static int
pack-priv Map<SerializedConfigValue.SerializedField, Object>
pack-priv Map<SerializedConfigValue.SerializedField, Object>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public URL
url()

Implements com.typesafe.config.ConfigOrigin.url.

Returns a URL describing the origin.

public SimpleConfigOrigin
withComments(List<String>
the comments used on the returned origin
comments
)

Implements com.typesafe.config.ConfigOrigin.withComments.

Returns a ConfigOrigin based on this one, but with the given comments.

public SimpleConfigOrigin
withLineNumber(int
the new line number
lineNumber
)

Implements com.typesafe.config.ConfigOrigin.withLineNumber.

Returns a ConfigOrigin based on this one, but with the given line number.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

commentsOrNullback to summary
private final List<String> commentsOrNull
descriptionback to summary
private final String description
endLineNumberback to summary
private final int endLineNumber
lineNumberback to summary
private final int lineNumber
MERGE_OF_PREFIXback to summary
pack-priv static final String MERGE_OF_PREFIX
originTypeback to summary
private final OriginType originType
resourceOrNullback to summary
private final String resourceOrNull
urlOrNullback to summary
private final String urlOrNull

Constructor Detail

SimpleConfigOriginback to summary
protected SimpleConfigOrigin(String description, int lineNumber, int endLineNumber, OriginType originType, String urlOrNull, String resourceOrNull, List<String> commentsOrNull)

Method Detail

addURLback to summary
pack-priv SimpleConfigOrigin addURL(URL url)
appendCommentsback to summary
pack-priv SimpleConfigOrigin appendComments(List<String> comments)
applyFieldsDeltaback to summary
pack-priv static Map<SerializedConfigValue.SerializedField, Object> applyFieldsDelta(Map<SerializedConfigValue.SerializedField, Object> base, Map<SerializedConfigValue.SerializedField, Object> delta) throws IOException
commentsback to summary
public List<String> comments()

Implements com.typesafe.config.ConfigOrigin.comments.

Doc from com.typesafe.config.ConfigOrigin.comments.

Returns any comments that appeared to "go with" this place in the file. Often an empty list, but never null. The details of this are subject to change, but at the moment comments that are immediately before an array element or object field, with no blank line after the comment, "go with" that element or field.

Returns:List<String>

any comments that seemed to "go with" this origin, empty list if none

Annotations
@Override
descriptionback to summary
public String description()

Implements com.typesafe.config.ConfigOrigin.description.

Doc from com.typesafe.config.ConfigOrigin.description.

Returns a string describing the origin of a value or exception. This will never return null.

Returns:String

string describing the origin

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

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
fieldsDeltaback to summary
pack-priv static Map<SerializedConfigValue.SerializedField, Object> fieldsDelta(Map<SerializedConfigValue.SerializedField, Object> base, Map<SerializedConfigValue.SerializedField, Object> child)
filenameback to summary
public String filename()

Implements com.typesafe.config.ConfigOrigin.filename.

Doc from com.typesafe.config.ConfigOrigin.filename.

Returns a filename describing the origin. This will return null if the origin was not a file.

Returns:String

filename of the origin or null

Annotations
@Override
fromBaseback to summary
pack-priv static SimpleConfigOrigin fromBase(SimpleConfigOrigin baseOrigin, Map<SerializedConfigValue.SerializedField, Object> delta) throws IOException
fromFieldsback to summary
pack-priv static SimpleConfigOrigin fromFields(Map<SerializedConfigValue.SerializedField, Object> m) throws IOException
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
lineNumberback to summary
public int lineNumber()

Implements com.typesafe.config.ConfigOrigin.lineNumber.

Doc from com.typesafe.config.ConfigOrigin.lineNumber.

Returns a line number where the value or exception originated. This will return -1 if there's no meaningful line number.

Returns:int

line number or -1 if none is available

Annotations
@Override
mergeOriginsback to summary
pack-priv static ConfigOrigin mergeOrigins(ConfigOrigin a, ConfigOrigin b)
mergeOriginsback to summary
pack-priv static ConfigOrigin mergeOrigins(List<? extends AbstractConfigValue> stack)
mergeOriginsback to summary
pack-priv static ConfigOrigin mergeOrigins(Collection<? extends ConfigOrigin> stack)
mergeThreeback to summary
private static SimpleConfigOrigin mergeThree(SimpleConfigOrigin a, SimpleConfigOrigin b, SimpleConfigOrigin c)
mergeTwoback to summary
private static SimpleConfigOrigin mergeTwo(SimpleConfigOrigin a, SimpleConfigOrigin b)
newEnvVariableback to summary
pack-priv static SimpleConfigOrigin newEnvVariable(String description)
newFileback to summary
pack-priv static SimpleConfigOrigin newFile(String filename)
newResourceback to summary
pack-priv static SimpleConfigOrigin newResource(String resource, URL url)
newResourceback to summary
pack-priv static SimpleConfigOrigin newResource(String resource)
newSimpleback to summary
pack-priv static SimpleConfigOrigin newSimple(String description)
newURLback to summary
pack-priv static SimpleConfigOrigin newURL(URL url)
originTypeback to summary
pack-priv OriginType originType()
prependCommentsback to summary
pack-priv SimpleConfigOrigin prependComments(List<String> comments)
resourceback to summary
public String resource()

Implements com.typesafe.config.ConfigOrigin.resource.

Doc from com.typesafe.config.ConfigOrigin.resource.

Returns a classpath resource name describing the origin. This will return null if the origin was not a classpath resource.

Returns:String

resource name of the origin or null

Annotations
@Override
similarityback to summary
private static int similarity(SimpleConfigOrigin a, SimpleConfigOrigin b)
toFieldsback to summary
pack-priv Map<SerializedConfigValue.SerializedField, Object> toFields()
toFieldsDeltaback to summary
pack-priv Map<SerializedConfigValue.SerializedField, Object> toFieldsDelta(SimpleConfigOrigin baseOrigin)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
urlback to summary
public URL url()

Implements com.typesafe.config.ConfigOrigin.url.

Doc from com.typesafe.config.ConfigOrigin.url.

Returns a URL describing the origin. This will return null if the origin has no meaningful URL.

Returns:URL

url of the origin or null

Annotations
@Override
withCommentsback to summary
public SimpleConfigOrigin withComments(List<String> comments)

Implements com.typesafe.config.ConfigOrigin.withComments.

Doc from com.typesafe.config.ConfigOrigin.withComments.

Returns a ConfigOrigin based on this one, but with the given comments. Does not modify this instance or any ConfigValues with this origin (since they are immutable). To set the returned origin to a ConfigValue, use ConfigValue#withOrigin.

Note that when the given comments are equal to the comments on this object, a new instance may not be created and this is returned directly.

Parameters
comments:List<String>

the comments used on the returned origin

Returns:SimpleConfigOrigin

the ConfigOrigin with the given comments

Annotations
@Override
withLineNumberback to summary
public SimpleConfigOrigin withLineNumber(int lineNumber)

Implements com.typesafe.config.ConfigOrigin.withLineNumber.

Doc from com.typesafe.config.ConfigOrigin.withLineNumber.

Returns a ConfigOrigin based on this one, but with the given line number. This origin must be a FILE, URL or RESOURCE. Does not modify this instance or any ConfigValues with this origin (since they are immutable). To set the returned origin to a ConfigValue, use ConfigValue#withOrigin.

Note that when the given lineNumber are equal to the lineNumber on this object, a new instance may not be created and this is returned directly.

Parameters
lineNumber:int

the new line number

Returns:SimpleConfigOrigin

the created ConfigOrigin

Annotations
@Override