StringRenderer

info.fingo.spata.text.StringRenderer
See theStringRenderer companion object
trait StringRenderer[-A]

Renderer from provided type to String. It is similar to toString, although it should handle nulls and unwrap Option content.

This renderer defines behavior to be implemented by concrete, given renderer instances for various types, used by render function from StringRenderer object.

Renderer's contravariance allows limiting givens to parent types if subclasses are formatted in the same way.

If the input is null, all provided given implementations return empty string as rendering result. If the input is a scala.Option, provided given instances render its content if or return empty string.

Type parameters

A

source type for rendering

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object booleanRendererFmt.type
object doubleRendererFmt.type
object longRendererFmt.type
object numberRendererFmt.type
object temporalRendererFmt.type
object intRenderer.type
object stringRenderer.type
Show all

Members list

Value members

Abstract methods

def apply(value: A): String

Renders provided value to string.

Renders provided value to string.

Value parameters

value

the input value

Attributes

Returns

rendered string

Note

This function uses "standard" string formatting, e.g. point as decimal separator or ISO date and time formats, without any locale support. Use FormattedStringRenderer if more control over target format is required.