net.corda.core.utilities

## Class UntrustworthyData<T>

- net.corda.core.utilities.UntrustworthyData<T>

-     public class UntrustworthyData<T>

  A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from a remote source that may be incentivised to pass us junk that violates basic assumptions and thus must be checked first. The wrapper helps you to avoid forgetting this vital step. Things you might want to check are:

  - Is this object the one you actually expected? Did the other side hand you back something technically valid but not what you asked for?

  - Is the object disobeying its own invariants?

  - Are any objects reachable from this object mismatched or not what you expected?

  - Is it suspiciously large or small?

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UntrustworthyData(T fromUntrustedWorld)` A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from a remote source that may be incentivised to pass us junk that violates basic assumptions and thus must be checked first. The wrapper helps you to avoid forgetting this vital step. Things you might want to check are:

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getData()` Deprecated.
    `<R> R` | `unwrap(UntrustworthyData.Validator<? super T,? extends R> validator)`
    `<R> R` | `validate(kotlin.jvm.functions.Function1<? super T,? extends R> validator)` Deprecated.

- - ### Constructor Detail

    - #### UntrustworthyData

          public UntrustworthyData(T fromUntrustedWorld)

      A small utility to approximate taint tracking: if a method gives you back one of these, it means the data came from a remote source that may be incentivised to pass us junk that violates basic assumptions and thus must be checked first. The wrapper helps you to avoid forgetting this vital step. Things you might want to check are:

      - Is this object the one you actually expected? Did the other side hand you back something technically valid but not what you asked for?

      - Is the object disobeying its own invariants?

      - Are any objects reachable from this object mismatched or not what you expected?

      - Is it suspiciously large or small?

  - ### Method Detail

    - #### getData

          public T getData()

      Deprecated.

    - #### unwrap

          public <R> R unwrap(UntrustworthyData.Validator<? super T,? extends R> validator)

    - #### validate

          public <R> R validate(kotlin.jvm.functions.Function1<? super T,? extends R> validator)

      Deprecated.