Methods to help capture stdin and stderr
Class that provides useful methods for resolving all kinds of things in configuration.
Trait that provides useful methods for resolving all kinds of things in configuration.
Trait that provides useful methods for resolving all kinds of things in configuration. Uses Config to retrieve configuration values in a type-safe way.
The config
method must be implemented by a subclass, giving the Config from which to retrieve configuration
values.
Overriding the keyRequested
method allows a call to be received each time a configuration path is requested.
Overriding the handle
method allows a subclass to determine how errors are handled.
Extending the asType
method allows a subclass to support additional (possibly custom) types.
The fetch
method is used to retrieve configuration values.
Retrieve a value at a given path:
scala> import com.fulcrumgenomics.commons.util.ConfigurationLike scala> import com.typesafe.config.{Config, ConfigFactory} scala> import scala.reflect.runtime.universe.TypeTag scala> val conf = new ConfigurationLike { val config: Config = ConfigFactory.parseString("""a.str = "string", a.int = 2, a.set = [1,2,3]""") def get[T : TypeTag](path: String): Option[T] = fetch[T](path) } scala> conf.get[String]("a.str") res0: Option[String] = Some(string) scala> conf.get[Int]("a.int") res1: Option[Int] = Some(2) scala> conf.get[Set[Int]]("a.set") res2: Option[Set[Int]] = Some(Set(1, 2, 3)) scala> conf.get[Set[Int]]("a.does-not-exist") res3: Option[Set[Int]] = None scala> conf.get[Int]("a.set") java.lang.IllegalArgumentException: Exception retrieving configuration key 'a.set' ...
A parser for files of text columns delimited by some character (e.g.
A parser for files of text columns delimited by some character (e.g. tab-delimited or csv).
Trait that can be mixed into classes to provide a Logger that is constructed at first access.
Very simple logging class that supports logging at multiple levels.
Super-simple class for counting occurrences of any [Numeric].
Super-simple class for counting occurrences of any [Numeric]. Will return zero for any item that has not been counted yet. Implements some useful methods to compute statistics when the objects being counted are numeric types.
Represents a row of parsed data.
Represents a row of parsed data. Provides methods for accessing values in a type-safe way either via apply() methods for non-optional fields or via get for optional fields.
Super-simple class for counting occurrences of any kind of object.
Super-simple class for counting occurrences of any kind of object. Will return zero for any item that has not been counted yet.
Companion object to Configuration.
Companion object for the Logger class that holds the system-wide log level, and a PrintWriter to write to.
Class that provides useful methods for resolving all kinds of things in configuration. Uses Config to retrieve configuration values in a type-safe way.
The
requestedKeys
method returns all the keys requested.The public methods to retrieve values are the
apply
,get
, andgetOrElse
methods.A common pattern is to create an
object
that extends this class, and reference that object when retrieving values from a path. An additional trait is created that references the custom configuration object, allowing other classes to mix in the additional trait to get access the the configuration methods that use the custom configuration object.A common pattern is to create an
object
that extends this class, and reference that object when retrieving values from a path.