Class BinaryObjectBuilderImpl

    • 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

      • getField

        public <T> T getField​(String name)
        Returns value assigned to the specified field. If the value is a binary object then an instance of BinaryObjectBuilder will be returned, which can be modified.

        Collections and maps returned from this method are modifiable.

        Specified by:
        getField in interface BinaryObjectBuilder
        Type Parameters:
        T - Type of the field value.
        Parameters:
        name - Field name.
        Returns:
        Field value.
      • 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:
        setField in interface BinaryObjectBuilder
        Type Parameters:
        T - Type of the field value.
        Parameters:
        name - Field name.
        val - Field value.
        type - Field type.
        Returns:
        this for chaining.
        See Also:
        BinaryObject.type()
      • 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.