Table of Contents

Class GenericConfigBuilder<T>

Namespace
MASES.KNet
Assembly
MASES.KNet.dll

Generic base configuration class

public class GenericConfigBuilder<T> : INotifyPropertyChanged, IGenericSerDesFactory, IDisposable where T : GenericConfigBuilder<T>, new()

Type Parameters

T
Inheritance
GenericConfigBuilder<T>
Implements
Derived
Inherited Members

Properties

AutoSelectBuffered

Set to true to automatically fallback to SerDesBuffered<T> when the JVM type is ByteBuffer

public bool AutoSelectBuffered { get; set; }

Property Value

bool

Remarks

The property is by default true to optimized data flow between CLR and JVM

KeySerDesSelector

The Type used to create an instance of ISerDesSelector<T> for keys with BuildKeySerDes<TKey, TJVMTKey>()

public Type KeySerDesSelector { get; set; }

Property Value

Type

ValueSerDesSelector

The Type used to create an instance of ISerDesSelector<T> for values with BuildValueSerDes<TValue, TJVMTValue>()

public Type ValueSerDesSelector { get; set; }

Property Value

Type

Methods

BuildKeySerDes<TKey, TJVMTKey>()

Builds an instance of ISerDes<T, TJVMT> using the Type defined in KeySerDesSelector

public ISerDes<TKey, TJVMTKey> BuildKeySerDes<TKey, TJVMTKey>()

Returns

ISerDes<TKey, TJVMTKey>

An instance of ISerDes<T, TJVMT>

Type Parameters

TKey

The type of the key

TJVMTKey

The JVM type of the key

Exceptions

InvalidOperationException

If KeySerDesSelector is null

BuildValueSerDes<TValue, TJVMTValue>()

Builds an instance of ISerDes<T, TJVMT> using the Type defined in ValueSerDesSelector

public ISerDes<TValue, TJVMTValue> BuildValueSerDes<TValue, TJVMTValue>()

Returns

ISerDes<TValue, TJVMTValue>

An instance of ISerDes<T, TJVMT>

Type Parameters

TValue

The type of the key

TJVMTValue

The JVM type of the key

Exceptions

InvalidOperationException

If ValueSerDesSelector is null

Clear()

Clear the current factory

public void Clear()

Clone()

Cones this instance

protected virtual T Clone()

Returns

T

T cloned

Create()

Creates an instance of T

public static T Create()

Returns

T

The instance of T

CreateFrom(T)

Creates an instance of T

public static T CreateFrom(T origin)

Parameters

origin T

Clone from this original instance

Returns

T

The instance of T clone from origin or new instance if origin is null

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ExistProperty(string)

Verify if the propertyName was previously set

public bool ExistProperty(string propertyName)

Parameters

propertyName string

The property name to be verified

Returns

bool

true if property exists, otherwise false

GetProperty<TData>(string)

Reads the propertyName set

public TData GetProperty<TData>(string propertyName)

Parameters

propertyName string

The property name to be get

Returns

TData

TData or default if property does not exists

Type Parameters

TData

The propert type

SetProperty(string, object)

Set the propertyName with value

public void SetProperty(string propertyName, object value)

Parameters

propertyName string

The property name to be set

value object

The property value to be set

ToMap()

Returns the Map<K, V> from the T instance

public Map<String, String> ToMap()

Returns

Map<String, String>

Map<K, V> containing the properties

ToProperties()

Returns the Properties from the T instance

public Properties ToProperties()

Returns

Properties

Properties containing the properties

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler

Operators

implicit operator Properties(GenericConfigBuilder<T>)

public static implicit operator Properties(GenericConfigBuilder<T> clazz)

Parameters

clazz GenericConfigBuilder<T>

Returns

Properties