public override bool Equals(object o) { if (o == this) { return(true); } if (!(o is ZipkinSpan)) { return(false); } ZipkinSpan that = (ZipkinSpan)o; return(TraceId.Equals(that.TraceId) && ((ParentId == null) ? (that.ParentId == null) : ParentId.Equals(that.ParentId)) && Id.Equals(that.Id) && Kind.Equals(that.Kind) && ((Name == null) ? (that.Name == null) : Name.Equals(that.Name)) && (Timestamp == that.Timestamp) && (Duration == that.Duration) && ((LocalEndpoint == null) ? (that.LocalEndpoint == null) : LocalEndpoint.Equals(that.LocalEndpoint)) && ((RemoteEndpoint == null) ? (that.RemoteEndpoint == null) : RemoteEndpoint.Equals(that.RemoteEndpoint)) && Annotations.SequenceEqual(that.Annotations) && Tags.SequenceEqual(that.Tags) && (Debug == that.Debug) && (Shared == that.Shared)); }
public override int SimilarityScore(PostBase post) { var otherPost = (YanderePost)post; int similarityScore = 0; if (FileUrl.Contains(".gif") || FileUrl.Contains(".webm")) { return(-10); } List <string> thisTags = new List <string>(GetTags().Split(' ').Where(w => w != "#tagme" && w != "")); List <string> postTags = new List <string>(otherPost.GetTags().Split(' ').Where(w => w != "#tagme" && w != "")); similarityScore += thisTags.Intersect(postTags).Count(); if (GetPostAuthor().Equals(otherPost.GetPostAuthor())) { similarityScore += 10; } if (ParentId != null && otherPost.ParentId != null) { if (ParentId.Equals(otherPost.ParentId)) { similarityScore += 10; } } return(similarityScore); }
public bool Equals(CIQueryParameters other) { return(other != null && CIType.Equals(other.CIType) && ParentId.Equals(other.ParentId) && Pattern.Equals(other.Pattern) && Page.Equals(other.Page) && ResultPerPage.Equals(other.ResultPerPage)); }
public bool Equals(SessionId other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(RootId.Equals(other.RootId) && ParentId.Equals(other.ParentId) && Id.Equals(other.Id)); }
public override IEnumerable <Guid> GetIdsForAncestorQuery() { if (!DisplayParentId.Equals(Guid.Empty)) { yield return(DisplayParentId); } else if (!ParentId.Equals(Guid.Empty)) { yield return(ParentId); } else { yield return(Id); } }
protected override QueryResult <BaseItem> GetItemsInternal(InternalItemsQuery query) { var parent = this as Folder; if (!DisplayParentId.Equals(Guid.Empty)) { parent = LibraryManager.GetItemById(DisplayParentId) as Folder ?? parent; } else if (!ParentId.Equals(Guid.Empty)) { parent = LibraryManager.GetItemById(ParentId) as Folder ?? parent; } return(new UserViewBuilder(UserViewManager, LibraryManager, Logger, UserDataManager, TVSeriesManager) .GetUserItems(parent, this, CollectionType, query)); }
public override IEnumerable <Guid> GetIdsForAncestorQuery() { var list = new List <Guid>(); if (!DisplayParentId.Equals(Guid.Empty)) { list.Add(DisplayParentId); } else if (!ParentId.Equals(Guid.Empty)) { list.Add(ParentId); } else { list.Add(Id); } return(list); }
public override int SimilarityScore(PostBase post) { var otherPost = (GelbooruPost)post; int similarityScore = 0; if (FileUrl.Contains(".gif") || FileUrl.Contains(".webm")) { return(-10); } List <string> thisTags = new List <string>(GetTags().Split(' ').Where(w => w != "#tagme" && w != "" && w != "#solo")); List <string> postTags = new List <string>(otherPost.GetTags().Split(' ').Where(w => w != "#tagme" && w != "" && w != "#solo")); foreach (var tag in thisTags.Intersect(postTags)) { if (ImportantTags.Contains(tag)) { similarityScore += 100; } else { similarityScore += 1; } } //similarityScore += thisTags.Intersect(postTags).Count(); if (!GetPostAuthor().Equals("danbooru") && GetPostAuthor().Equals(otherPost.GetPostAuthor())) { similarityScore += 100; } if (ParentId != null && otherPost.ParentId != null) { if (ParentId.Equals(otherPost.ParentId)) { similarityScore += 100; } } return(similarityScore); }
/// <summary> /// Returns true if Order instances are equal /// </summary> /// <param name="other">Instance of Order to be compared</param> /// <returns>Boolean</returns> public bool Equals(Order other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Instrument == other.Instrument || Instrument != null && Instrument.Equals(other.Instrument) ) && ( Qty == other.Qty || Qty != null && Qty.Equals(other.Qty) ) && ( Side == other.Side || Side != null && Side.Equals(other.Side) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( FilledQty == other.FilledQty || FilledQty != null && FilledQty.Equals(other.FilledQty) ) && ( AvgPrice == other.AvgPrice || AvgPrice != null && AvgPrice.Equals(other.AvgPrice) ) && ( LimitPrice == other.LimitPrice || LimitPrice != null && LimitPrice.Equals(other.LimitPrice) ) && ( StopPrice == other.StopPrice || StopPrice != null && StopPrice.Equals(other.StopPrice) ) && ( ParentId == other.ParentId || ParentId != null && ParentId.Equals(other.ParentId) ) && ( ParentType == other.ParentType || ParentType != null && ParentType.Equals(other.ParentType) ) && ( Duration == other.Duration || Duration != null && Duration.Equals(other.Duration) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) )); }
public virtual bool Equals(ContentCategory <TIncremId, TCreatedBy> other) => other.IsNotNull() && ParentId.Equals(other.ParentId) && Name == other.Name;
/// <summary> /// Returns true if Span instances are equal /// </summary> /// <param name="other">Instance of Span to be compared</param> /// <returns>Boolean</returns> public bool Equals(Span other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( TraceId == other.TraceId || TraceId != null && TraceId.Equals(other.TraceId) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( ParentId == other.ParentId || ParentId != null && ParentId.Equals(other.ParentId) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Kind == other.Kind || Kind != null && Kind.Equals(other.Kind) ) && ( Timestamp == other.Timestamp || Timestamp != null && Timestamp.Equals(other.Timestamp) ) && ( Duration == other.Duration || Duration != null && Duration.Equals(other.Duration) ) && ( Debug == other.Debug || Debug != null && Debug.Equals(other.Debug) ) && ( Shared == other.Shared || Shared != null && Shared.Equals(other.Shared) ) && ( LocalEndpoint == other.LocalEndpoint || LocalEndpoint != null && LocalEndpoint.Equals(other.LocalEndpoint) ) && ( RemoteEndpoint == other.RemoteEndpoint || RemoteEndpoint != null && RemoteEndpoint.Equals(other.RemoteEndpoint) ) && ( Annotations == other.Annotations || Annotations != null && Annotations.SequenceEqual(other.Annotations) ) && ( Tags == other.Tags || Tags != null && Tags.Equals(other.Tags) )); }