SimpleConfigDocument

org.ekrich.config.impl.SimpleConfigDocument
final class SimpleConfigDocument extends ConfigDocument

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def equals(other: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Any
override def hasPath(path: String): Boolean

Returns a boolean indicating whether or not a ConfigDocument has a value at the desired path. null counts as a value for purposes of this check.

Returns a boolean indicating whether or not a ConfigDocument has a value at the desired path. null counts as a value for purposes of this check.

Value parameters

path

the path to check

Attributes

Returns

true if the path exists in the document, otherwise false

Definition Classes
override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any
override def render: String

The original text of the input, modified if necessary with any replaced or added values.

The original text of the input, modified if necessary with any replaced or added values.

Attributes

Returns

the modified original text

Definition Classes
override def withValue(path: String, newValue: ConfigValue): ConfigDocument

Returns a new ConfigDocument that is a copy of the current ConfigDocument, but with the desired value set at the desired path. Works like withValueText, but takes a ConfigValue instead of a string.

Returns a new ConfigDocument that is a copy of the current ConfigDocument, but with the desired value set at the desired path. Works like withValueText, but takes a ConfigValue instead of a string.

Value parameters

newValue

the value to set at the desired path, represented as a ConfigValue. The rendered text of the ConfigValue will be inserted into the ConfigDocument.

path

the path at which to set the desired value

Attributes

Returns

a copy of the ConfigDocument with the desired value at the desired path

Definition Classes
override def withValueText(path: String, newValue: String): ConfigDocument

Returns a new ConfigDocument that is a copy of the current ConfigDocument, but with the desired value set at the desired path. If the path exists, it will remove all duplicates before the final occurrence of the path, and replace the value at the final occurrence of the path. If the path does not exist, it will be added. If the document has an array as the root value, an exception will be thrown.

Returns a new ConfigDocument that is a copy of the current ConfigDocument, but with the desired value set at the desired path. If the path exists, it will remove all duplicates before the final occurrence of the path, and replace the value at the final occurrence of the path. If the path does not exist, it will be added. If the document has an array as the root value, an exception will be thrown.

Value parameters

newValue

the value to set at the desired path, represented as a string. This string will be parsed into a ConfigNode using the same options used to parse the entire document, and the text will be inserted as-is into the document. Leading and trailing comments, whitespace, or newlines are not allowed, and if present an exception will be thrown. If a concatenation is passed in for newValue but the document was parsed with JSON, the first value in the concatenation will be parsed and inserted into the ConfigDocument.

path

the path at which to set the desired value

Attributes

Returns

a copy of the ConfigDocument with the desired value at the desired path

Definition Classes
override def withoutPath(path: String): ConfigDocument

Returns a new ConfigDocument that is a copy of the current ConfigDocument, but with all values at the desired path removed. If the path does not exist in the document, a copy of the current document will be returned. If there is an array at the root, an exception will be thrown.

Returns a new ConfigDocument that is a copy of the current ConfigDocument, but with all values at the desired path removed. If the path does not exist in the document, a copy of the current document will be returned. If there is an array at the root, an exception will be thrown.

Value parameters

path

the path to remove from the document

Attributes

Returns

a copy of the ConfigDocument with the desired value removed from the document.

Definition Classes