net.corda.core.utilities

## Class ApiUtils

- net.corda.core.utilities.ApiUtils

-     public class ApiUtils

  Utility functions to reduce boilerplate when developing HTTP APIs

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApiUtils(CordaRPCOps rpc)` Utility functions to reduce boilerplate when developing HTTP APIs

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CordaRPCOps` | `getRpc()`
    `javax.ws.rs.core.Response` | `withParty(java.lang.String partyKeyStr, kotlin.jvm.functions.Function1<? super java.lang.String,? extends javax.ws.rs.core.Response> notFound, kotlin.jvm.functions.Function1<? super net.corda.core.crypto.Party,? extends javax.ws.rs.core.Response> found)` Get a party and then execute the passed function with the party public key as a parameter. Usage: withParty(key) { doSomethingWith(it) }

- - ### Constructor Detail

    - #### ApiUtils

          public ApiUtils(CordaRPCOps rpc)

      Utility functions to reduce boilerplate when developing HTTP APIs

  - ### Method Detail

    - #### withParty

          public javax.ws.rs.core.Response withParty(java.lang.String partyKeyStr,
                                                     kotlin.jvm.functions.Function1<? super java.lang.String,? extends javax.ws.rs.core.Response> notFound,
                                                     kotlin.jvm.functions.Function1<? super net.corda.core.crypto.Party,? extends javax.ws.rs.core.Response> found)

      Get a party and then execute the passed function with the party public key as a parameter. Usage: withParty(key) { doSomethingWith(it) }

    - #### getRpc

          public CordaRPCOps getRpc()