All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hypertino.inflector.naming.SnakeCaseBuilder.scala Maven / Gradle / Ivy

package com.hypertino.inflector.naming

class SnakeCaseBuilder(possibleLength: Option[Int] = None) extends IdentifierBuilder {
  private val sb = possibleLength.map {
    new StringBuilder(_)
  } getOrElse {
    new StringBuilder
  }

  override def divider(): Unit = {
    sb.append('_')
  }

  override def regular(c: Char): Unit = {
    sb.append(c.toLower)
  }

  override def toString() = {
    sb.toString()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy