Packages

object JsonDiff extends Logging

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsonDiff
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. case class Result(expected: JsonNode, expectedPrettyString: String, actual: JsonNode, actualPrettyString: String) extends Product with Serializable

    A JsonDiff result

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def assertDiff[T](expected: T, actual: T, normalizeFn: (JsonNode) => JsonNode, p: PrintStream): Unit

    Asserts that the actual equals the expected.

    Asserts that the actual equals the expected. Will throw an AssertionError with details printed to the given PrintStream using the given normalizeFn to normalize the actual contents.

    expected

    the expected json

    actual

    the actual or received json

    normalizeFn

    a function to apply to the actual json in order to "normalize" values.

    p

    the PrintStream for reporting details

    Annotations
    @throws(scala.this.throws.<init>$default$1[AssertionError])
    Exceptions thrown

    AssertionError - when the expected does not match the actual.

  6. def assertDiff[T](expected: T, actual: T, p: PrintStream): Unit

    Asserts that the actual equals the expected.

    Asserts that the actual equals the expected. Will throw an AssertionError with details printed to the given PrintStream.

    expected

    the expected json

    actual

    the actual or received json

    p

    the PrintStream for reporting details

    Annotations
    @throws(scala.this.throws.<init>$default$1[AssertionError])
    Exceptions thrown

    AssertionError - when the expected does not match the actual.

  7. def assertDiff[T](expected: T, actual: T, normalizeFn: (JsonNode) => JsonNode): Unit

    Asserts that the actual equals the expected.

    Asserts that the actual equals the expected. Will throw an AssertionError with details printed to System.out using the given normalizeFn to normalize the actual contents.

    expected

    the expected json

    actual

    the actual or received json

    normalizeFn

    a function to apply to the actual json in order to "normalize" values.

    Annotations
    @throws(scala.this.throws.<init>$default$1[AssertionError])
    Exceptions thrown

    AssertionError - when the expected does not match the actual.

  8. def assertDiff[T](expected: T, actual: T): Unit

    Asserts that the actual equals the expected.

    Asserts that the actual equals the expected. Will throw an AssertionError with details printed to System.out.

    expected

    the expected json

    actual

    the actual or received json

    Annotations
    @throws(scala.this.throws.<init>$default$1[AssertionError])
    Exceptions thrown

    AssertionError - when the expected does not match the actual.

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def debug(marker: Marker, message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  11. def debug(message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  12. def debug(marker: Marker, message: => Any): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  13. def debug(message: => Any): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  14. def debugResult[T](message: => String)(fn: => T): T

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger.

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger. The incoming string message should contain a single %s which will be replaced with the result[T] of the given function.

    Example:

    infoResult("The answer is: %s") {"42"}
    Attributes
    protected[this]
    Definition Classes
    Logging
  15. def diff[T](expected: T, actual: T, normalizeFn: (JsonNode) => JsonNode): Option[Result]

    Computes the diff for two snippets of json both of expected type T.

    Computes the diff for two snippets of json both of expected type T. If a difference is detected a Result is returned otherwise a None.

    expected

    the expected json

    actual

    the actual or received json

    normalizeFn

    a function to apply to the actual json in order to "normalize" values.

    returns

    if a difference is detected a Result is returned otherwise a None.

    Usage

    private def normalize(jsonNode: JsonNode): JsonNode = jsonNode match {
      case on: ObjectNode => on.put("time", "1970-01-01T00:00:00Z")
      case _ => jsonNode
    }
    
    val expected = """{"foo": "bar", "time": ""1970-01-01T00:00:00Z"}"""
    val actual = ??? ({"foo": "bar", "time": ""2021-05-14T00:00:00Z"})
    val result: Option[JsonDiff.Result] = JsonDiff.diff(expected, actual, normalize)
  16. def diff[T](expected: T, actual: T): Option[Result]

    Computes the diff for two snippets of json both of expected type T.

    Computes the diff for two snippets of json both of expected type T. If a difference is detected a Result is returned otherwise a None.

    expected

    the expected json

    actual

    the actual or received json

    returns

    if a difference is detected a Result is returned otherwise a None.

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def error(marker: Marker, message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  20. def error(message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  21. def error(marker: Marker, message: => Any): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  22. def error(message: => Any): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  23. def errorResult[T](message: => String)(fn: => T): T

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger.

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger. The incoming string message should contain a single %s which will be replaced with the result[T] of the given function.

    Example:

    infoResult("The answer is: %s") {"42"}
    Attributes
    protected[this]
    Definition Classes
    Logging
  24. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def info(marker: Marker, message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  28. def info(message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  29. def info(marker: Marker, message: => Any): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  30. def info(message: => Any): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  31. def infoResult[T](message: => String)(fn: => T): T

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger.

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger. The incoming string message should contain a single %s which will be replaced with the result[T] of the given function.

    Example:

    infoResult("The answer is: %s") {"42"}
    Attributes
    protected[this]
    Definition Classes
    Logging
  32. def isDebugEnabled(marker: Marker): Boolean

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data.

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  33. def isDebugEnabled: Boolean

    Determines if the named log level is enabled on the underlying logger.

    Determines if the named log level is enabled on the underlying logger. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  34. def isErrorEnabled(marker: Marker): Boolean

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data.

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  35. def isErrorEnabled: Boolean

    Determines if the named log level is enabled on the underlying logger.

    Determines if the named log level is enabled on the underlying logger. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  36. def isInfoEnabled(marker: Marker): Boolean

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data.

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  37. def isInfoEnabled: Boolean

    Determines if the named log level is enabled on the underlying logger.

    Determines if the named log level is enabled on the underlying logger. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  38. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  39. def isTraceEnabled(marker: Marker): Boolean

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data.

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  40. def isTraceEnabled: Boolean

    Determines if the named log level is enabled on the underlying logger.

    Determines if the named log level is enabled on the underlying logger. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  41. def isWarnEnabled(marker: Marker): Boolean

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data.

    Determines if the named log level is enabled on the underlying logger taking into consideration the given org.slf4j.Marker data. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  42. def isWarnEnabled: Boolean

    Determines if the named log level is enabled on the underlying logger.

    Determines if the named log level is enabled on the underlying logger. Returns true if enabled, false otherwise.

    Attributes
    protected[this]
    Definition Classes
    Logging
  43. final def logger: Logger

    Return the underlying com.twitter.util.logging.Logger

    Return the underlying com.twitter.util.logging.Logger

    returns

    a com.twitter.util.logging.Logger

    Attributes
    protected[this]
    Definition Classes
    Logging
  44. final def loggerName: String

    Return the name of the underlying com.twitter.util.logging.Logger

    Return the name of the underlying com.twitter.util.logging.Logger

    returns

    a String name

    Attributes
    protected[this]
    Definition Classes
    Logging
  45. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  47. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  48. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  49. def toSortedString(jsonNode: JsonNode): String

    Creates a string representation of the given JsonNode with entries sorted alphabetically by key.

    Creates a string representation of the given JsonNode with entries sorted alphabetically by key.

    jsonNode

    - input JsonNode

    returns

    string representation of the JsonNode.

  50. def toString(): String
    Definition Classes
    AnyRef → Any
  51. def trace(marker: Marker, message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  52. def trace(message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  53. def trace(marker: Marker, message: => Any): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  54. def trace(message: => Any): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  55. def traceResult[T](message: => String)(fn: => T): T

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger.

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger. The incoming string message should contain a single %s which will be replaced with the result[T] of the given function.

    Example:

    infoResult("The answer is: %s") {"42"}
    Attributes
    protected[this]
    Definition Classes
    Logging
  56. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  57. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  58. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  59. def warn(marker: Marker, message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  60. def warn(message: => Any, cause: Throwable): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  61. def warn(marker: Marker, message: => Any): Unit

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Logs the given message at the named log level with the underlying logger taking into consideration the given org.slf4j.Marker data.

    Attributes
    protected[this]
    Definition Classes
    Logging
  62. def warn(message: => Any): Unit

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Logs the given message at the named log level using call-by-name for the message parameter with the underlying logger.

    Attributes
    protected[this]
    Definition Classes
    Logging
  63. def warnResult[T](message: => String)(fn: => T): T

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger.

    Log the given message at the named log level formatted with the result of the passed in function using the underlying logger. The incoming string message should contain a single %s which will be replaced with the result[T] of the given function.

    Example:

    infoResult("The answer is: %s") {"42"}
    Attributes
    protected[this]
    Definition Classes
    Logging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped