ProxyHandler

class ProxyHandler<T : Any>(name: String)(source)

ProxyHandler is a utility class that dynamically creates a proxy object of a specified type. The proxy implements default behavior for methods such as toString, equals, property access, and method invocation, providing a placeholder implementation.

This class is typically used to generate mock or dummy objects for testing or prototyping purposes.

Parameters

T

The type of the proxy object to be created. Must be a non-abstract class.

name

A string identifier associated with the proxy. This is used in placeholder implementation to display information about the proxy.

Constructors

Link copied to clipboard
constructor(name: String)

Functions

Link copied to clipboard
fun createProxy(): T

Creates a proxy instance of type T. The proxy is a dummy implementation that provides default behavior for overridden methods such as toString, equals, and unimplemented operations.