object ConfigValueFactory
This class holds some static factory methods for building ConfigValue instances. See also ConfigFactory which has methods for parsing files and certain in-memory data structures.
- Alphabetic
- By Inheritance
- ConfigValueFactory
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fromAnyRef(obj: AnyRef): ConfigValue
See the other overload fromAnyRef(Object,String) for details, this one just uses a default origin description.
See the other overload fromAnyRef(Object,String) for details, this one just uses a default origin description.
- returns
a new ConfigValue
- def fromAnyRef(obj: AnyRef, originDescription: String): ConfigValue
Creates a ConfigValue from a plain Java boxed value, which may be a
Boolean,Number,String,Map,Iterable, ornull.Creates a ConfigValue from a plain Java boxed value, which may be a
Boolean,Number,String,Map,Iterable, ornull. AMapmust be aMapfrom String to more values that can be supplied tofromAnyRef(). AnIterablemust iterate over more values that can be supplied tofromAnyRef(). AMapwill become a ConfigObject and anIterablewill become a ConfigList. If theIterableis not an ordered collection, results could be strange, sinceConfigListis ordered.In a
Mappassed tofromAnyRef(), the map's keys are plain keys, not path expressions. So if yourMaphas a key "foo.bar" then you will get one object with a key called "foo.bar", rather than an object with a key "foo" containing another object with a key "bar".The originDescription will be used to set the
origin()field on theConfigValue. It should normally be the name of the file the values came from, or something short describing the value such as "default settings". The originDescription is prefixed to error messages so users can tell where problematic values are coming from.Supplying the result of
ConfigValue.unwrapped()to this function is guaranteed to work and should give you back aConfigValuethat matches the one you unwrapped. The re-wrappedConfigValuewill lose some information that was present in the original such as its origin, but it will have matching values.If you pass in a
ConfigValueto this function, it will be returned unmodified. (TheoriginDescriptionwill be ignored in this case.)This function throws if you supply a value that cannot be converted to a ConfigValue, but supplying such a value is a bug in your program, so you should never handle the exception. Just fix your program (or report a bug against this library).
- originDescription
name of origin file or brief description of what the value is
- returns
a new value
- def fromIterable(values: Iterable[_]): ConfigList
See the other overload of fromIterable(jl.Iterable, String) for details, this one just uses a default origin description.
See the other overload of fromIterable(jl.Iterable, String) for details, this one just uses a default origin description.
- values
list of plain Java values
- returns
a new ConfigList
- def fromIterable(values: Iterable[_], originDescription: String): ConfigList
See the fromAnyRef(Object,String) documentation for details.
See the fromAnyRef(Object,String) documentation for details. This is a typesafe wrapper that only works on
java.lang.Iterableand returns ConfigList rather than ConfigValue.- values
list of plain Java values
- originDescription
description to use in ConfigOrigin of created values
- returns
a new ConfigList value
- def fromMap(values: Map[String, _]): ConfigObject
See the other overload fromMap(Map,String) for details, this one just uses a default origin description.
See the other overload fromMap(Map,String) for details, this one just uses a default origin description.
See also ConfigFactory.parseMap(ju.Map) which interprets the keys in the map as path expressions.
- values
map from keys to plain Java values
- returns
a new ConfigObject
- def fromMap(values: Map[String, _], originDescription: String): ConfigObject
See the fromAnyRef(Object,String) documentation for details.
See the fromAnyRef(Object,String) documentation for details. This is a typesafe wrapper that only works on
java.util.Mapand returns ConfigObject rather than ConfigValue.If your
Maphas a key "foo.bar" then you will get one object with a key called "foo.bar", rather than an object with a key "foo" containing another object with a key "bar". The keys in the map are keys; not path expressions. That is, theMapcorresponds exactly to a singleConfigObject. The keys will not be parsed or modified, and the values are wrapped in ConfigValue. To get nestedConfigObject, some of the values in the map would have to be more maps.See also ConfigFactory.parseMap(Map,String) which interprets the keys in the map as path expressions.
- values
map from keys to plain Java values
- originDescription
description to use in ConfigOrigin of created values
- returns
a new ConfigObject value
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)