Package-level declarations

Types

Link copied to clipboard
class KeepMaskStrategy(keepPrefix: Int = 0, keepSuffix: Int = 0) : MaskStrategy

The built-in mask: keeps keepPrefix leading and keepSuffix trailing code points and masks the rest.

Link copied to clipboard
annotation class Mask(val keepPrefix: Int = 0, val keepSuffix: Int = 0, val strategy: KClass<out MaskStrategy> = MaskStrategy::class)

How query results mask a Sensitive value.

Link copied to clipboard
fun interface MaskStrategy

Masks one string value of a query result. It must not return null and should keep an empty string empty.

Link copied to clipboard
annotation class QueryAlias(val value: String)

Other logical paths a query may use for this field, typically its names before a rename.

Link copied to clipboard
annotation class QueryDecimal(val scale: Int)

Declares a numeric field a fixed-point decimal with scale fraction digits, so query consumers format and total it at that precision: @field:QueryDecimal(scale = 2). Never inferred: a BigDecimal does not tell its precision. A field has one semantic type, so this cannot combine with QueryTemporal, QueryMoney, QueryDuration or QueryReference.

Link copied to clipboard

Declares a numeric field a length of time counted in unit, so query consumers format it as a duration: @field:QueryDuration(TimeUnit.SECONDS). Never inferred: an Int does not tell its unit. A field has one semantic type, so this cannot combine with QueryTemporal, QueryDecimal, QueryMoney or QueryReference.

Link copied to clipboard
annotation class QueryMoney(val currency: String = "", val currencyField: String = "", val scale: Int = -1)

Declares a numeric field an amount of money, in exactly one of a fixed ISO 4217 currency or the currency held by the sibling string field currencyField (a property of the same object or element):

Link copied to clipboard
annotation class QueryReference(val aggregateName: String, val contextName: String = "")

Declares a field (or the elements of an array field) the id of an aggregate, so query consumers can look the aggregate up and link to it: @field:QueryReference("member"). contextName defaults to the bounded context of the model that declares the field. A property of type AggregateId needs no annotation: its aggregateId is a reference to the aggregate its own contextName and aggregateName name. A field has one semantic type, so this cannot combine with QueryTemporal, QueryDecimal, QueryMoney or QueryDuration.

Link copied to clipboard
annotation class QueryTemporal(val unit: TimeUnit = TimeUnit.MILLISECONDS, val pattern: String = "")

Declares how a field encodes time when its type does not say so, so time conditions and date histograms can use it. Standard time types (Instant, LocalDate, OffsetDateTime, …) need no annotation.

Link copied to clipboard
annotation class Sensitive(val level: SensitivityLevel, val mask: Mask = Mask())

Declares a sensitive field of a query model: its level and how query results mask it.

Link copied to clipboard

How much the query subsystem protects a Sensitive field's raw value. Both levels mask the value in every query result; they differ in what a query may do with the raw value.