Trait/Object

com.github.kiran002.kissconfig.config.api

TypeHelper

Related Docs: object TypeHelper | package api

Permalink

trait TypeHelper extends AnyRef

Interface used to define a TypeHelper.

Given a type (T), the TypeHelper is expected to be able

  1. Extract configuration value from the config object 2. Parse the value to the target type
Example:
  1. class StringTypeHelper extends TypeHelper {
        private val stringExtractor: Input => Any  = x => x.config.getString(x.configKey.get)
         override def canHandle(objType: universe.Type): Boolean =
                       objType.typeSymbol==universe.typeOf[String].typeSymbol
        override def get(objType: universe.Type): Input => Any = stringExtractor
     }
Note

More example are available under com.github.kiran002.kissconfig.config.impl

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TypeHelper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def canHandle(objType: scala.reflect.api.JavaUniverse.Type): Boolean

    Permalink

    Is the typehelper able to handle this particular type (objType)

    Is the typehelper able to handle this particular type (objType)

    returns

    : true if it can handle objType false otherwise

  2. abstract def get(objType: scala.reflect.api.JavaUniverse.Type): (Input) ⇒ Any

    Permalink

    Returns a function that can be used to extract values compatible with objType

    Returns a function that can be used to extract values compatible with objType

    objType

    type of the object

    returns

    : function, that takes config object and config key as input and returns the extracted value

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val BooleanType: scala.reflect.api.JavaUniverse.Type

    Permalink
    Attributes
    protected
  5. val DoubleType: scala.reflect.api.JavaUniverse.Type

    Permalink
    Attributes
    protected
  6. val IntegerType: scala.reflect.api.JavaUniverse.Type

    Permalink
    Attributes
    protected
  7. val StringType: scala.reflect.api.JavaUniverse.Type

    Permalink
    Attributes
    protected
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped