Permalink
Browse files

Added SkinnyHttpSession#getAs[A](String)

  • Loading branch information...
1 parent 1721c22 commit 5778a10a1932dae4a3aab8ab29858102cfd25ba7 @seratch seratch committed Mar 7, 2014
@@ -15,6 +15,8 @@ trait SkinnyHttpSession {
def getAttribute(name: String): Option[Any]
+ def getAs[A](name: String): Option[A] = getAttribute(name).map(_.asInstanceOf[A])
+
def setAttribute(name: String, value: Any): Unit
def removeAttribute(name: String): Unit
@@ -4,7 +4,8 @@ import javax.servlet.http.HttpSession
import skinny.session.jdbc.SkinnySession
import grizzled.slf4j.Logging
-class SkinnyHttpSessionJDBCImpl(underlying: HttpSession, skinnySession: SkinnySession) extends SkinnyHttpSession with Logging {
+case class SkinnyHttpSessionJDBCImpl(underlying: HttpSession, skinnySession: SkinnySession)
+ extends SkinnyHttpSession with Logging {
override def save() = skinnySession.save()

0 comments on commit 5778a10

Please sign in to comment.