pl.touk.nussknacker.engine.api.Comment.scala Maven / Gradle / Ivy
package pl.touk.nussknacker.engine.api
class Comment private (val content: String) extends AnyVal {
override def toString: String = content
}
object Comment {
def from(content: String): Option[Comment] = {
if (content.isEmpty) None else Some(new Comment(content))
}
def unsafeFrom(content: String): Comment = {
from(content).getOrElse(throw new IllegalArgumentException("Comment content cannot be empty"))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy