package dendrites
Utility functions for case classes and Properties files
ccToMap
Case class fields to map of field names and values
val kvMap = ccToMap(cc) kvMap foreach { case (key, value) => gRecord.put(key, value) }
isElementEqual
Is case class field at index a specified type
system.actorOf(props) ! GetCustomerAccountBalances(2, Set(Checking, Savings, MoneyMarket)) receiveOne(2.seconds) match { case result: IndexedSeq[Product] ⇒ { assert(isElementEqual(result(0), 0, Checking)) assert(isElementEqual(result(1), 0, Savings)) assert(isElementEqual(result(2), 0, MoneyMarket)) } case result ⇒ assert(false, s"Expect 3 AccountTypes, got $result") }
loadProperties
Load Properties file from classpath
val prop: Properties = loadProperties("kafkaProducer.properties")
- Alphabetic
- By Inheritance
- dendrites
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
ccToMap(cc: Product): Map[String, Any]
Extract case class elements into a Map
Extract case class elements into a Map
- cc
case class (Product is super type)
- returns
map of field names and values
-
def
isElementEqual(p: Product, ele: Int, theType: Any): Boolean
Does the indexed case class field have desired type?
Does the indexed case class field have desired type?
- ele
field element
- theType
type to match
- returns
true if element has theType
-
def
loadProperties(filename: String, path: String = "/"): Properties
Read Properties file
Read Properties file
- returns
Properties object