Class BinaryObjectBuilderImpl
- java.lang.Object
-
- org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl
-
- All Implemented Interfaces:
BinaryObjectBuilder
public class BinaryObjectBuilderImpl extends Object implements BinaryObjectBuilder
-
-
Constructor Summary
Constructors Constructor Description BinaryObjectBuilderImpl(BinaryContext ctx, int typeId, String typeName)BinaryObjectBuilderImpl(BinaryContext ctx, String clsName)BinaryObjectBuilderImpl(BinaryObjectImpl obj)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaffinityFieldName(String affFieldName)Set known affinity key field name.BinaryObjectbuild()Builds binary object.<T> TgetField(String name)Returns value assigned to the specified field.BinaryObjectBuilderImplremoveField(String name)Removes field from binary object.BinaryObjectBuildersetField(String name, @Nullable BinaryObjectBuilder builder)Sets field value.BinaryObjectBuildersetField(String name, Object val0)Sets field value.<T> BinaryObjectBuildersetField(String name, T val, Class<? super T> type)Sets field value with value type specification.inttypeId()static BinaryObjectBuilderImplwrap(BinaryObject obj)Creates builder initialized by specified binary object.
-
-
-
Constructor Detail
-
BinaryObjectBuilderImpl
public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName)
- Parameters:
clsName- Class name.ctx- Binary context.
-
BinaryObjectBuilderImpl
public BinaryObjectBuilderImpl(BinaryContext ctx, int typeId, String typeName)
- Parameters:
typeName- Type name.ctx- Context.typeId- Type id.
-
BinaryObjectBuilderImpl
public BinaryObjectBuilderImpl(BinaryObjectImpl obj)
- Parameters:
obj- Object to wrap.
-
-
Method Detail
-
build
public BinaryObject build()
Builds binary object.- Specified by:
buildin interfaceBinaryObjectBuilder- Returns:
- Binary object.
-
getField
public <T> T getField(String name)
Returns value assigned to the specified field. If the value is a binary object then an instance ofBinaryObjectBuilderwill be returned, which can be modified.Collections and maps returned from this method are modifiable.
- Specified by:
getFieldin interfaceBinaryObjectBuilder- Type Parameters:
T- Type of the field value.- Parameters:
name- Field name.- Returns:
- Field value.
-
setField
public BinaryObjectBuilder setField(String name, Object val0)
Sets field value.- Specified by:
setFieldin interfaceBinaryObjectBuilder- Parameters:
name- Field name.val0- Field value (cannot benull).- Returns:
thisfor chaining.- See Also:
BinaryObject.type()
-
setField
public <T> BinaryObjectBuilder setField(String name, @Nullable T val, Class<? super T> type)
Sets field value with value type specification.Field type is needed for proper metadata update.
- Specified by:
setFieldin interfaceBinaryObjectBuilder- Type Parameters:
T- Type of the field value.- Parameters:
name- Field name.val- Field value.type- Field type.- Returns:
thisfor chaining.- See Also:
BinaryObject.type()
-
setField
public BinaryObjectBuilder setField(String name, @Nullable @Nullable BinaryObjectBuilder builder)
Sets field value.This method should be used if field is binary object.
- Specified by:
setFieldin interfaceBinaryObjectBuilder- Parameters:
name- Field name.builder- Builder for object field.- Returns:
thisfor chaining.
-
removeField
public BinaryObjectBuilderImpl removeField(String name)
Removes field from binary object.- Specified by:
removeFieldin interfaceBinaryObjectBuilder- Parameters:
name- Field name.- Returns:
thisinstance for chaining.
-
wrap
public static BinaryObjectBuilderImpl wrap(BinaryObject obj)
Creates builder initialized by specified binary object.- Parameters:
obj- Binary object to initialize builder.- Returns:
- New builder.
-
typeId
public int typeId()
- Returns:
- Object type id.
-
affinityFieldName
public void affinityFieldName(String affFieldName)
Set known affinity key field name.- Parameters:
affFieldName- Affinity key field name.
-
-