StaticMethodCaller

public final class StaticMethodCaller

Helper to call a no-arg constructor or static getter to obtain an instance of a specified type. This is used for logging platform "plugins". It is expected that these constructors/methods will be invoked once during logger initialization and then the results cached in the platform class (thus there is no requirement for the class being invoked to handle caching of the result).

Functions

Link copied to clipboard
public static T getInstanceFromSystemProperty<T>(String propertyName, Class<T> type)
@Nullable()
public static @Nullable() T getInstanceFromSystemProperty<T>(String propertyName, @Nullable() @Nullable() String defaultValue, Class<T> type)
Attempts to get an instance of the given type that is specified by the given propertyName, returning null if that is not possible for any reason.