All Projects → softwaremill → stringmask

softwaremill / stringmask

Licence: Apache-2.0 license
A micro-library for macro-based case class field masking in .toString

Programming Languages

scala
5932 projects

Labels

Projects that are alternatives of or similar to stringmask

valast
Convert Go values to their AST
Stars: ✭ 251 (+422.92%)
Mutual labels:  tostring
StatePrinter
Automating unit testing and ToString() coding
Stars: ✭ 89 (+85.42%)
Mutual labels:  tostring
to-string-verifier
To String Verifier provides an easy and convenient way to test the toString method on your class.
Stars: ✭ 25 (-47.92%)
Mutual labels:  tostring
lombok-rs
Lombok port for Rust
Stars: ✭ 31 (-35.42%)
Mutual labels:  tostring

stringmask

Maven Central License 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.11 and 2.12

libraryDependencies ++= Seq(
  "com.softwaremill.stringmask" %% "stringmask" % "1.3.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, "[email protected]", new Date(1458732695220L))

user.toString

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].