Ejemplo n.º 1
0
        /// <summary>
        /// Compares two EVSEAvailabilityStatus for equality.
        /// </summary>
        /// <param name="EVSEAvailabilityStatus">An EVSEAvailabilityStatus to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(EVSEAvailabilityStatus EVSEAvailabilityStatus)
        {
            if ((Object)EVSEAvailabilityStatus == null)
            {
                return(false);
            }

            return(EVSEId.Equals(EVSEAvailabilityStatus.EVSEId) &&
                   StatusEventDate.Equals(EVSEAvailabilityStatus.StatusEventDate) &&
                   AvailabilityStatus.Equals(EVSEAvailabilityStatus.AvailabilityStatus) &&

                   ((!AvailabilityStatusUntil.HasValue && !EVSEAvailabilityStatus.AvailabilityStatusUntil.HasValue) ||
                    (AvailabilityStatusUntil.HasValue && EVSEAvailabilityStatus.AvailabilityStatusUntil.HasValue && AvailabilityStatusUntil.Value.Equals(EVSEAvailabilityStatus.AvailabilityStatusUntil.Value))) &&

                   ((!AvailabilityStatusComment.IsNeitherNullNorEmpty() && !EVSEAvailabilityStatus.AvailabilityStatusComment.IsNeitherNullNorEmpty()) ||
                    (AvailabilityStatusComment.IsNeitherNullNorEmpty() && EVSEAvailabilityStatus.AvailabilityStatusComment.IsNeitherNullNorEmpty() && AvailabilityStatusComment.Equals(EVSEAvailabilityStatus.AvailabilityStatusComment))));
        }
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="SetChargingStationAvailabilityStatusRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetChargingStationAvailabilityStatusRequest SetChargingStationAvailabilityStatusRequest)
        {
            if ((Object)SetChargingStationAvailabilityStatusRequest == null)
            {
                return(false);
            }

            return(((!TransactionId.HasValue && !SetChargingStationAvailabilityStatusRequest.TransactionId.HasValue) ||
                    (TransactionId.HasValue && SetChargingStationAvailabilityStatusRequest.TransactionId.HasValue && TransactionId.Value.Equals(SetChargingStationAvailabilityStatusRequest.TransactionId.Value))) &&

                   PartnerId.Equals(SetChargingStationAvailabilityStatusRequest.PartnerId) &&
                   OperatorId.Equals(SetChargingStationAvailabilityStatusRequest.OperatorId) &&
                   ChargingStationId.Equals(SetChargingStationAvailabilityStatusRequest.ChargingStationId) &&
                   StatusEventDate.Equals(SetChargingStationAvailabilityStatusRequest.StatusEventDate) &&
                   AvailabilityStatus.Equals(SetChargingStationAvailabilityStatusRequest.AvailabilityStatus) &&

                   ((!AvailabilityStatusUntil.HasValue && !SetChargingStationAvailabilityStatusRequest.AvailabilityStatusUntil.HasValue) ||
                    (AvailabilityStatusUntil.HasValue && SetChargingStationAvailabilityStatusRequest.AvailabilityStatusUntil.HasValue && AvailabilityStatusUntil.Value.Equals(SetChargingStationAvailabilityStatusRequest.AvailabilityStatusUntil.Value))) &&

                   ((!AvailabilityStatusComment.IsNeitherNullNorEmpty() && !SetChargingStationAvailabilityStatusRequest.AvailabilityStatusComment.IsNeitherNullNorEmpty()) ||
                    (AvailabilityStatusComment.IsNeitherNullNorEmpty() && SetChargingStationAvailabilityStatusRequest.AvailabilityStatusComment.IsNeitherNullNorEmpty() && AvailabilityStatusComment.Equals(SetChargingStationAvailabilityStatusRequest.AvailabilityStatusComment))));
        }