Class JNetCoreExtensions
- Namespace
- MASES.JNet.Specific.Extensions
- Assembly
- MASES.JNet.dll
Extension class
public static class JNetCoreExtensions
- Inheritance
-
JNetCoreExtensions
- Inherited Members
Methods
Class<TClass>(TClass)
Retrieve the Class<T> from the TClass
public static Class<TClass> Class<TClass>(this TClass _) where TClass : IJVMBridgeBase, new()
Parameters
_TClass
Returns
Type Parameters
TClassA class extending IJVMBridgeBase
DirectBufferWithWrap<TData, TWrap>(TData[], bool, bool, int, Func<ByteBuffer, TWrap>)
The method creates a ByteBuffer and wrap it into TWrap
public static TWrap DirectBufferWithWrap<TData, TWrap>(this TData[] data, bool useMemoryControlBlock = true, bool arrangeCapacity = true, int timeToLive = -1, Func<ByteBuffer, TWrap> converter = null) where TWrap : IJVMBridgeBase, new()
Parameters
dataTData[]The array of
TDatato be wrappeduseMemoryControlBlockboolAppends to the end of the
dataa memory block will be used to controls and arbitrates memory between CLR and JVMarrangeCapacityboolIf true the
TDataarray indatawill be resized to the next power of 2, so capacity will be memory aligned and the limit of java.nio.ByteBuffer will be current size ofdatatimeToLiveintThe time to live, expressed in milliseconds, the underlying memory shall remain available; if the time to live expires the pinned memory is retired leaving potentially the JVM under the possibility of an access violation.
converterFunc<ByteBuffer, TWrap>A Func<T, TResult> that receives the prepared ByteBuffer and shall return
TWrap
Returns
- TWrap
The
TWrapinstance
Type Parameters
TDataThe data to be wrapped
TWrapThe wrapping class
GetStaticPropertyOn(Type, Type, string)
Generic static property getter
public static object GetStaticPropertyOn(this Type origin, Type target, string propertyName)
Parameters
originTypeThe origin
targetTypeThe target Type where the static property was defined
propertyNamestringThe property name
Returns
- object
The property value
GetStaticPropertyOn<TContainingClass>(Type, string)
Generic static property getter
public static object GetStaticPropertyOn<TContainingClass>(this Type origin, string propertyName)
Parameters
Returns
- object
The property value
Type Parameters
TContainingClassThe target Type where the static property was defined
RunStaticMethodOn(Type, Type, string, params object[])
Executes a static method defined in destination
public static object RunStaticMethodOn(this Type origin, Type destination, string methodName, params object[] args)
Parameters
originTypeThe origin
destinationTypeThe target Type where the static method was defined
methodNamestringThe method name
argsobject[]The method arguments
Returns
- object
The method result
RunStaticMethodOn(Type, Type, string, Type[], params object[])
Executes a static method defined in destination
public static object RunStaticMethodOn(this Type origin, Type destination, string methodName, Type[] types, params object[] args)
Parameters
originTypeThe origin
destinationTypeThe target Type where the static method was defined
methodNamestringThe method name
typesType[]The Type of the arguments
argsobject[]The method arguments
Returns
- object
The method result
RunStaticMethodOn<TContainingClass>(Type, string, params object[])
Executes a static method defined in source
public static object RunStaticMethodOn<TContainingClass>(this Type source, string methodName, params object[] args)
Parameters
Returns
- object
The method result
Type Parameters
TContainingClassThe target Type where the static method was defined
SetStaticPropertyOn(Type, Type, string, object)
Generic static property setter
public static void SetStaticPropertyOn(this Type origin, Type destination, string propertyName, object value)
Parameters
originTypeThe origin
destinationTypeThe target Type where the static property was defined
propertyNamestringThe property name
valueobjectThe property value
SetStaticPropertyOn<TContainingClass>(Type, string, object)
Generic static property setter
public static void SetStaticPropertyOn<TContainingClass>(this Type origin, string propertyName, object value)
Parameters
Type Parameters
TContainingClassThe target Type where the static property was defined
TraverseUntil(Type, Type)
Traverse the class chain from source until t
public static Type TraverseUntil(this Type source, Type t)