public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } if (Description.Length != 0) { hash ^= Description.GetHashCode(); } if (createdAt_ != null) { hash ^= CreatedAt.GetHashCode(); } if (CreatedBy.Length != 0) { hash ^= CreatedBy.GetHashCode(); } if (modifiedAt_ != null) { hash ^= ModifiedAt.GetHashCode(); } if (Done != false) { hash ^= Done.GetHashCode(); } if (metadata_ != null) { hash ^= Metadata.GetHashCode(); } if (resultCase_ == ResultOneofCase.Error) { hash ^= Error.GetHashCode(); } if (resultCase_ == ResultOneofCase.Response) { hash ^= Response.GetHashCode(); } hash ^= (int)resultCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// Output all properties /// </summary> /// <returns>A string</returns> public override string ToString() { var toString = new StringBuilder(); toString.Append("ID: ").AppendLine(Id); toString.Append("CreatedAt: ").AppendLine(CreatedAt.ToString(CultureInfo.InvariantCulture)); toString.Append("ModifiedAt: ").AppendLine(ModifiedAt.ToString(CultureInfo.InvariantCulture)).AppendLine(); toString.Append("OriginalWidth: ").AppendLine(OriginalWidth.ToString(CultureInfo.InvariantCulture)); toString.Append("OriginalHeight: ").AppendLine(OriginalHeight.ToString(CultureInfo.InvariantCulture)); toString.Append("Url: ").AppendLine(Url); toString.Append("Sizes: ").AppendLine(Sizes.Keys.Count.ToString(CultureInfo.InvariantCulture)); foreach (var size in Sizes) { toString.Append(size.Key).Append(" - ").AppendLine(size.Value); } return(toString.ToString()); }
public override int GetHashCode() { //x return base.GetHashCode(); //x return new { Id, CreatedAt, ModifiedAt, SoftDelete, Name, Url }.GetHashCode(); unchecked { int hash = 17; //x (int)2166136261; //x (int)397; const int primeNumber = 23; //x 16777619; //TODO do suitable nullity checks hash = hash * primeNumber ^ Id.GetHashCode(); hash = hash * primeNumber ^ CreatedAt.GetHashCode(); hash = hash * primeNumber ^ ModifiedAt.GetHashCode(); hash = hash * primeNumber ^ SoftDelete.GetHashCode(); hash = hash * primeNumber ^ (Name == null ? 0 : Name.GetHashCode()); hash = hash * primeNumber ^ (Url == null ? 0 : Url.GetHashCode()); return(hash); } }
public void MergeFrom(Operation other) { if (other == null) { return; } if (other.Id.Length != 0) { Id = other.Id; } if (other.Description.Length != 0) { Description = other.Description; } if (other.createdAt_ != null) { if (createdAt_ == null) { CreatedAt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } CreatedAt.MergeFrom(other.CreatedAt); } if (other.CreatedBy.Length != 0) { CreatedBy = other.CreatedBy; } if (other.modifiedAt_ != null) { if (modifiedAt_ == null) { ModifiedAt = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } ModifiedAt.MergeFrom(other.ModifiedAt); } if (other.Done != false) { Done = other.Done; } if (other.metadata_ != null) { if (metadata_ == null) { Metadata = new global::Google.Protobuf.WellKnownTypes.Any(); } Metadata.MergeFrom(other.Metadata); } switch (other.ResultCase) { case ResultOneofCase.Error: if (Error == null) { Error = new global::Google.Rpc.Status(); } Error.MergeFrom(other.Error); break; case ResultOneofCase.Response: if (Response == null) { Response = new global::Google.Protobuf.WellKnownTypes.Any(); } Response.MergeFrom(other.Response); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public override string ToString() { var sb = new StringBuilder(); sb.AppendFormat("type: {0} id: {1} created_by: {2} created_at: {3} modified_by: {4} modified_at: {5} owned_by: {6} name: {7} description: {8} size: {9}", Type, Id, CreatedBy, CreatedAt.HasValue ? CreatedAt.ToString() : "null", ModifedBy, ModifiedAt.HasValue ? ModifiedAt.ToString() : "null", OwnedBy, Name, Description, Size); if (ItemCollection != null) { foreach (var item in ItemCollection.Entries) { if (item != null) { sb.Append("\n\t"); sb.Append(item); } } } return(sb.ToString()); }