/// <summary> /// Constructor. /// </summary> /// <param name="igniteBinary">Binary.</param> /// <param name="parent">Parent builder.</param> /// <param name="obj">Initial binary object.</param> /// <param name="desc">Type descriptor.</param> public BinaryObjectBuilder(IgniteBinary igniteBinary, BinaryObjectBuilder parent, BinaryObject obj, IBinaryTypeDescriptor desc) { Debug.Assert(igniteBinary != null); Debug.Assert(obj != null); Debug.Assert(desc != null); _igniteBinary = igniteBinary; _parent = parent ?? this; _obj = obj; _desc = desc; _hashCode = obj.GetHashCode(); }
/// <summary> /// Constructor. /// </summary> /// <param name="binary">Binary.</param> /// <param name="parent">Parent builder.</param> /// <param name="obj">Initial binary object.</param> /// <param name="desc">Type descriptor.</param> public BinaryObjectBuilder(Binary binary, BinaryObjectBuilder parent, BinaryObject obj, IBinaryTypeDescriptor desc) { Debug.Assert(binary != null); Debug.Assert(desc != null); _binary = binary; _parent = parent ?? this; _desc = desc; if (obj != null) { _obj = obj; _hashCode = obj.GetHashCode(); } else { _obj = BinaryFromDescriptor(desc); } }