Skip to content

String

Represents textual values.

  • Kotlin Definition: StringDefinition
  • Kotlin Value : String
  • Maryk Yaml Definition: String
  • Value
  • Map Key or Value
  • Inside List/Set
  • required - default true
  • final - default false
  • unique - default false
  • regEx - regular expression to match complete value against
  • minSize - minimum length of the string. Default unset.
  • maxSize - maximum length of the string. Default unset.
  • minValue - default false. Minimum value (Sort start value)
  • maxValue - default false. Maximum value (Sort end value)
  • default - the default value to be used if value was not set.

Example of a String property definition for use within a Model

val codeName by string(
index = 1u,
required = true,
final = true,
unique = true,
minSize = 3,
maxSize = 6,
default = "baa",
minValue = "aab",
maxValue = "ddda",
regEx = "[abcd]{3,4}"
)

Example of a separate String property definition

val def = StringDefinition(
required = true,
final = true,
unique = true,
minSize = 3,
maxSize = 6,
default = "baa",
minValue = "aab",
maxValue = "ddda",
regEx = "[abcd]{3,4}"
)

Strings are stored as UTF-8 encoded bytes. With transport the LENGTH_DELIMITED wiretype is used

String