public void MergeFrom(Candidate other) { if (other == null) { return; } if (other.Value.Length != 0) { Value = other.Value; } if (other.Text.Length != 0) { Text = other.Text; } if (other.confidence_ != null) { if (confidence_ == null) { Confidence = new global::Ssn.Type.Confidence(); } Confidence.MergeFrom(other.Confidence); } if (other.boundingBox_ != null) { if (boundingBox_ == null) { BoundingBox = new global::Ssn.Type.BoundingPoly(); } BoundingBox.MergeFrom(other.BoundingBox); } if (other.Type != global::Ssn.Type.Candidate.Types.Type.Unknown) { Type = other.Type; } if (other.PageRef != 0) { PageRef = other.PageRef; } if (other.modelMetadata_ != null) { if (modelMetadata_ == null) { ModelMetadata = new global::Ssn.Type.ModelSpec(); } ModelMetadata.MergeFrom(other.ModelMetadata); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch (tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Value = input.ReadString(); break; } case 18: { Text = input.ReadString(); break; } case 26: { if (confidence_ == null) { Confidence = new global::Ssn.Type.Confidence(); } input.ReadMessage(Confidence); break; } case 34: { if (boundingBox_ == null) { BoundingBox = new global::Ssn.Type.BoundingPoly(); } input.ReadMessage(BoundingBox); break; } case 40: { Type = (global::Ssn.Type.Candidate.Types.Type)input.ReadEnum(); break; } case 48: { PageRef = input.ReadUInt32(); break; } case 58: { if (modelMetadata_ == null) { ModelMetadata = new global::Ssn.Type.ModelSpec(); } input.ReadMessage(ModelMetadata); break; } } } }