net.corda.core.protocols / ProtocolLogicRefFactory

# ProtocolLogicRefFactory

`class ProtocolLogicRefFactory : SingletonSerializeAsToken`

A class for conversion to and from ProtocolLogic and ProtocolLogicRef instances.

Validation of types is performed on the way in and way out in case this object is passed between JVMs which might have differing whitelists.

TODO: Ways to populate whitelist of "blessed" protocols per node/party TODO: Ways to populate argument types whitelist. Per node/party or global? TODO: Align with API related logic for passing in ProtocolLogic references (ProtocolRef) TODO: Actual support for AppContext / AttachmentsClassLoader

### Constructors

<init> | `ProtocolLogicRefFactory()``ProtocolLogicRefFactory(protocolWhitelist: Map<String, Set<String>>)` A class for conversion to and from ProtocolLogic and ProtocolLogicRef instances.

### Functions

create | `fun create(type: Class<out ProtocolLogic<*>>, vararg args: Any?): ProtocolLogicRef` Create a ProtocolLogicRef for the Kotlin primary constructor or Java constructor and the given args.
createKotlin | `fun createKotlin(protocolLogicClassName: String, args: Map<String, Any?>, attachments: List<SecureHash> = emptyList()): ProtocolLogicRef` Create a ProtocolLogicRef for the Kotlin primary constructor of a named ProtocolLogic `fun createKotlin(type: Class<out ProtocolLogic<*>>, args: Map<String, Any?>): ProtocolLogicRef` Create a ProtocolLogicRef by trying to find a Kotlin constructor that matches the given args.
toProtocolLogic | `fun toProtocolLogic(ref: ProtocolLogicRef): ProtocolLogic<*>`

### Inherited Functions

toToken | `open fun toToken(context: SerializeAsTokenContext): SerializationToken`