public EventToPutWithIdOnRecordFilterMatch <TId> DeepCloneWithEventToPut(EventToPutWithId <TId> eventToPut)
        {
            var result = new EventToPutWithIdOnRecordFilterMatch <TId>(
                this.RecordExistsMatchStrategy.DeepClone(),
                eventToPut,
                this.ChainOfResponsibilityLinkMatchStrategy.DeepClone());

            return(result);
        }
        public EventToPutWithIdOnHandlingStatusMatch <TId> DeepCloneWithEventToPut(EventToPutWithId <TId> eventToPut)
        {
            var result = new EventToPutWithIdOnHandlingStatusMatch <TId>(
                this.StatusToMatch.DeepClone(),
                this.CompositeHandlingStatusMatchStrategy.DeepClone(),
                eventToPut,
                this.ChainOfResponsibilityLinkMatchStrategy.DeepClone());

            return(result);
        }
Exemple #3
0
        public EventToPutWithId <TId> DeepCloneWithId(TId id)
        {
            var result = new EventToPutWithId <TId>(
                id,
                this.EventToPut?.DeepClone(),
                this.StreamRepresentation?.DeepClone(),
                this.UpdateTimestampOnPut.DeepClone(),
                this.Tags?.DeepClone());

            return(result);
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventToPutWithIdOnRecordFilterMatch{TId}"/> class.
        /// </summary>
        /// <param name="recordExistsMatchStrategy">The <see cref="RecordExistsMatchStrategy"/> to use with supplied filter.</param>
        /// <param name="eventToPut">The event to put on a match.</param>
        /// <param name="chainOfResponsibilityLinkMatchStrategy">OPTIONAL strategy override to determine what to do in the execution on a match; DEFAULT is Halt and Complete.</param>
        public EventToPutWithIdOnRecordFilterMatch(
            RecordExistsMatchStrategy recordExistsMatchStrategy,
            EventToPutWithId <TId> eventToPut,
            ChainOfResponsibilityLinkMatchStrategy chainOfResponsibilityLinkMatchStrategy = ChainOfResponsibilityLinkMatchStrategy.MatchHaltsEvaluationOfChainAndCompletes)
        {
            recordExistsMatchStrategy.MustForArg(nameof(recordExistsMatchStrategy)).NotBeEqualTo(CompositeHandlingStatusMatchStrategy.Unknown);
            eventToPut.MustForArg(nameof(eventToPut)).NotBeNull();
            chainOfResponsibilityLinkMatchStrategy.MustForArg(nameof(chainOfResponsibilityLinkMatchStrategy)).NotBeEqualTo(ChainOfResponsibilityLinkMatchStrategy.Unknown);

            this.RecordExistsMatchStrategy = recordExistsMatchStrategy;
            this.EventToPut = eventToPut;
            this.ChainOfResponsibilityLinkMatchStrategy = chainOfResponsibilityLinkMatchStrategy;
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EventToPutWithIdOnHandlingStatusMatch{TId}"/> class.
        /// </summary>
        /// <param name="statusToMatch">The <see cref="CompositeHandlingStatus"/> to match.</param>
        /// <param name="compositeHandlingStatusMatchStrategy">The <see cref="CompositeHandlingStatusMatchStrategy"/> to use with <paramref name="statusToMatch"/>.</param>
        /// <param name="eventToPut">The event to put on a match.</param>
        /// <param name="chainOfResponsibilityLinkMatchStrategy">OPTIONAL strategy override to determine what to do in the execution on a match; DEFAULT is Halt and Complete.</param>
        public EventToPutWithIdOnHandlingStatusMatch(
            CompositeHandlingStatus statusToMatch,
            CompositeHandlingStatusMatchStrategy compositeHandlingStatusMatchStrategy,
            EventToPutWithId <TId> eventToPut,
            ChainOfResponsibilityLinkMatchStrategy chainOfResponsibilityLinkMatchStrategy = ChainOfResponsibilityLinkMatchStrategy.MatchHaltsEvaluationOfChainAndCompletes)
        {
            statusToMatch.MustForArg(nameof(statusToMatch)).NotBeEqualTo(CompositeHandlingStatus.Unknown);
            compositeHandlingStatusMatchStrategy.MustForArg(nameof(compositeHandlingStatusMatchStrategy)).NotBeEqualTo(CompositeHandlingStatusMatchStrategy.Unknown);
            eventToPut.MustForArg(nameof(eventToPut)).NotBeNull();
            chainOfResponsibilityLinkMatchStrategy.MustForArg(nameof(chainOfResponsibilityLinkMatchStrategy)).NotBeEqualTo(ChainOfResponsibilityLinkMatchStrategy.Unknown);

            this.StatusToMatch = statusToMatch;
            this.CompositeHandlingStatusMatchStrategy = compositeHandlingStatusMatchStrategy;
            this.EventToPut = eventToPut;
            this.ChainOfResponsibilityLinkMatchStrategy = chainOfResponsibilityLinkMatchStrategy;
        }
Exemple #6
0
        /// <inheritdoc />
        public bool Equals(EventToPutWithId <TId> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            var result = this.Id.IsEqualTo(other.Id) &&
                         this.EventToPut.IsEqualTo(other.EventToPut) &&
                         this.StreamRepresentation.IsEqualTo(other.StreamRepresentation) &&
                         this.UpdateTimestampOnPut.IsEqualTo(other.UpdateTimestampOnPut) &&
                         this.Tags.IsEqualTo(other.Tags);

            return(result);
        }