Interface IBinaryObjectBuilder
binary object builder. Provides ability to build binary objects dynamically without having class definitions.
Note that type ID is required in order to build binary object. Usually it is enough to provide a simple type name and Ignite will generate the type ID automatically.
Namespace: Apache.Ignite.Core.Binary
Assembly: Apache.Ignite.Core.dll
Syntax
public interface IBinaryObjectBuilder
Methods
Build()
Build the object.
Declaration
IBinaryObject Build()
Returns
Type | Description |
---|---|
IBinaryObject | Resulting binary object. |
GetField<T>(String)
Get object field value. If value is another binary object, then builder for this object will be returned. If value is a container for other objects (array, ICollection, IDictionary), then container will be returned with primitive types in deserialized form and binary objects as builders. Any change in builder or collection returned through this method will be reflected in the resulting binary object after build.
Declaration
T GetField<T>(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Field name. |
Returns
Type | Description |
---|---|
T | Field value. |
Type Parameters
Name | Description |
---|---|
T |
RemoveField(String)
Remove object field.
Declaration
IBinaryObjectBuilder RemoveField(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Field name. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetArrayField<T>(String, T[])
Sets the array field.
Declaration
IBinaryObjectBuilder SetArrayField<T>(string fieldName, T[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
T[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
Type Parameters
Name | Description |
---|---|
T |
SetBooleanArrayField(String, Boolean[])
Sets the boolean array field.
Declaration
IBinaryObjectBuilder SetBooleanArrayField(string fieldName, bool[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Boolean[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetBooleanField(String, Boolean)
Sets the boolean field.
Declaration
IBinaryObjectBuilder SetBooleanField(string fieldName, bool val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Boolean | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetByteArrayField(String, Byte[])
Sets the byte array field.
Declaration
IBinaryObjectBuilder SetByteArrayField(string fieldName, byte[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Byte[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetByteField(String, Byte)
Sets the byte field.
Declaration
IBinaryObjectBuilder SetByteField(string fieldName, byte val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Byte | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetCharArrayField(String, Char[])
Sets the char array field.
Declaration
IBinaryObjectBuilder SetCharArrayField(string fieldName, char[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Char[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetCharField(String, Char)
Sets the char field.
Declaration
IBinaryObjectBuilder SetCharField(string fieldName, char val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Char | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetCollectionField(String, ICollection)
Sets the collection field.
Declaration
IBinaryObjectBuilder SetCollectionField(string fieldName, ICollection val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
ICollection | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetDecimalArrayField(String, Nullable<Decimal>[])
Sets the decimal array field.
Declaration
IBinaryObjectBuilder SetDecimalArrayField(string fieldName, decimal? [] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Nullable<System.Decimal>[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetDecimalField(String, Nullable<Decimal>)
Sets the decimal field.
Declaration
IBinaryObjectBuilder SetDecimalField(string fieldName, decimal? val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Nullable<System.Decimal> | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetDictionaryField(String, IDictionary)
Sets the dictionary field.
Declaration
IBinaryObjectBuilder SetDictionaryField(string fieldName, IDictionary val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
IDictionary | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetDoubleArrayField(String, Double[])
Sets the double array field.
Declaration
IBinaryObjectBuilder SetDoubleArrayField(string fieldName, double[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Double[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetDoubleField(String, Double)
Sets the double field.
Declaration
IBinaryObjectBuilder SetDoubleField(string fieldName, double val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Double | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetEnumArrayField<T>(String, T[])
Sets the enum array field.
Declaration
IBinaryObjectBuilder SetEnumArrayField<T>(string fieldName, T[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
T[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
Type Parameters
Name | Description |
---|---|
T |
SetEnumField<T>(String, T)
Sets the enum field.
Declaration
IBinaryObjectBuilder SetEnumField<T>(string fieldName, T val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
T | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
Type Parameters
Name | Description |
---|---|
T |
SetField<T>(String, T)
Set object field value. Value can be of any type including other IBinaryObject and other builders.
Value type for metadata is determined as typeof(T)
;
use SetField<T>(String, T, Type) overload to override.
Declaration
IBinaryObjectBuilder SetField<T>(string fieldName, T val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Field name. |
T | val | Field value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
Type Parameters
Name | Description |
---|---|
T |
SetField<T>(String, T, Type)
Set object field value. Value can be of any type including other IBinaryObject and other builders.
Declaration
IBinaryObjectBuilder SetField<T>(string fieldName, T val, Type valType)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Field name. |
T | val | Field value. |
Type | valType | Field value type for metadata (see also GetFieldTypeName(String)). |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
Type Parameters
Name | Description |
---|---|
T |
SetFloatArrayField(String, Single[])
Sets the float array field.
Declaration
IBinaryObjectBuilder SetFloatArrayField(string fieldName, float[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Single[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetFloatField(String, Single)
Sets the float field.
Declaration
IBinaryObjectBuilder SetFloatField(string fieldName, float val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Single | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetGuidArrayField(String, Nullable<Guid>[])
Sets the guid array field.
Declaration
IBinaryObjectBuilder SetGuidArrayField(string fieldName, Guid? [] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Nullable<Guid>[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetGuidField(String, Nullable<Guid>)
Sets the guid field.
Declaration
IBinaryObjectBuilder SetGuidField(string fieldName, Guid? val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Nullable<Guid> | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetIntArrayField(String, Int32[])
Sets the int array field.
Declaration
IBinaryObjectBuilder SetIntArrayField(string fieldName, int[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Int32[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetIntField(String, Int32)
Sets the int field.
Declaration
IBinaryObjectBuilder SetIntField(string fieldName, int val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Int32 | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetLongArrayField(String, Int64[])
Sets the long array field.
Declaration
IBinaryObjectBuilder SetLongArrayField(string fieldName, long[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Int64[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetLongField(String, Int64)
Sets the long field.
Declaration
IBinaryObjectBuilder SetLongField(string fieldName, long val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Int64 | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetShortArrayField(String, Int16[])
Sets the short array field.
Declaration
IBinaryObjectBuilder SetShortArrayField(string fieldName, short[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Int16[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetShortField(String, Int16)
Sets the short field.
Declaration
IBinaryObjectBuilder SetShortField(string fieldName, short val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Int16 | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetStringArrayField(String, String[])
Sets the string array field.
Declaration
IBinaryObjectBuilder SetStringArrayField(string fieldName, string[] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.String[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetStringField(String, String)
Sets the string field.
Declaration
IBinaryObjectBuilder SetStringField(string fieldName, string val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.String | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetTimestampArrayField(String, Nullable<DateTime>[])
Sets the timestamp array field.
Declaration
IBinaryObjectBuilder SetTimestampArrayField(string fieldName, DateTime? [] val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Nullable<DateTime>[] | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |
SetTimestampField(String, Nullable<DateTime>)
Sets the timestamp field.
Declaration
IBinaryObjectBuilder SetTimestampField(string fieldName, DateTime? val)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
System.Nullable<DateTime> | val | The value. |
Returns
Type | Description |
---|---|
IBinaryObjectBuilder | Current builder instance. |