CompareOptions

class CompareOptions(val includeTypes: Boolean = false, val ignoreKeys: Set<String> = emptySet(), val ignorePaths: Set<String> = emptySet())(source)

How values are compared (SPEC.md §9.2).

  • includeTypes: objects are equal only when they also have the same assigned type (SPEC.md §6); values given as JSON have no types.

  • ignoreKeys: object members with one of these keys are left out at every depth.

  • ignorePaths: values at these paths (RFC 9535 singular queries as in SPEC.md §6.1, $ being the compared values) are left out, with everything inside them.

Throws IllegalArgumentException for invalid path syntax or keys that aren't valid Unicode.

Constructors

Link copied to clipboard
constructor(includeTypes: Boolean = false, ignoreKeys: Set<String> = emptySet(), ignorePaths: Set<String> = emptySet())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copy(includeTypes: Boolean = this.includeTypes, ignoreKeys: Set<String> = this.ignoreKeys, ignorePaths: Set<String> = this.ignorePaths): CompareOptions

These options with the given ones changed; the result is validated like a new instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String