This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val string = "https://demo.openbankproject.com/obp/v4.0.0/config/obp/v4.0.0/dynamic/pet/PET_ID/PET_A_ID" | |
val pattern = ".*/(([A-Z]+_)*ID$)".r | |
//val string = "bankId=1&accountId=2&transactionId=3" | |
//val pattern = "bankId=(.+)&accountId=(.+)&transactionId=(.+)".r | |
string match { | |
case pattern(a,b) => println(a,b) //matched group(1) assigned to variable a483 | |
case _ => println("nothing") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.liftweb.json._ | |
//implicit val formats = net.liftweb.json.DefaultFormats | |
trait InternalCaseClassTrait{ | |
def text: String | |
} | |
case class InternalCaseClass( | |
text: String | |
) extends InternalCaseClassTrait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object mPinResets extends MappedOneToMany(PinReset, PinReset.card, OrderBy(PinReset.id, Ascending)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.liftweb.json._ | |
import scala.text.Document | |
implicit val formats = net.liftweb.json.DefaultFormats | |
case class InternalCaseClass( | |
text: String | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def updateUserAccountViews( user: ResourceUser ) = { | |
val accounts = getBanks.flatMap { bank => { | |
val bankId = bank.bankId.value | |
logger.debug(s"ObpJvm updateUserAccountViews for user.email ${user.email} user.name ${user.name} at bank ${bankId}") | |
val parameters = new JHashMap | |
parameters.put("userId", user.name) | |
parameters.put("bankId", bankId) | |
val response = jvmNorth.get("getAccounts", Transport.Target.accounts, parameters) | |
// todo response.error().isPresent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
successJsonResponse(Extraction.decompose(json)(formats = new Formats { | |
import java.text.{ParseException, SimpleDateFormat} | |
val dateFormat = new DateFormat { | |
def parse(s: String) = try { | |
Some(formatter.parse(s)) | |
} catch { | |
case e: ParseException => None | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.liftweb.common.{Box, Empty, Failure, Full} | |
import net.liftweb.util.Helpers.tryo | |
//val option: Option[Null] = Option(null) | |
val box1 = Full(null) | |
val box2 = Full("") | |
val box3 = Empty | |
val box4 = None | |
val box5 = Failure("hongwei") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.liftweb.common.{Box, Empty, Failure, Full} | |
//val option: Option[Null] = Option(null) | |
val box1 = Full(null) | |
val box2 = Full("") | |
val box3 = Empty | |
val box4 = None | |
val box5 = Failure("hongwei") |