Skip to content

A micro-library for macro-based case class field masking in .toString

License

Notifications You must be signed in to change notification settings

mkubala/stringmask

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stringmask

Maven Central ![Software License](https://img.shields.io/badge/license-Apache 2-brightgreen.svg?style=flat) Build Status

A micro-library for macro-based case class field masking in .toString(). Inspired by blog by Juan Pedro Moreno @47deg: http://www.47deg.com/blog/scala-macros-annotate-your-case-classes

#Using stringmask Builds are available for Scala 2.10.x and 2.11.x

libraryDependencies ++= Seq(
  "com.softwaremill.stringmask" %% "stringmask" % "1.0.0",
  compilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)
)

Example usage:

import com.softwaremill.macros.customize.{customize, mask}
import java.util.Date

@customize
case class User(id: Long, @mask email: String, @mask dob: Date)
val user = User(1, "johndoe@email.com", new Date(1458732695220L))

user.toString

should return User(1,***,***)

About

A micro-library for macro-based case class field masking in .toString

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%