public ConstantExpressionRepresentation <T> DeepCloneWithValue(T value)
        {
            var result = new ConstantExpressionRepresentation <T>(
                this.Type?.DeepClone(),
                this.NodeType.DeepClone(),
                value);

            return(result);
        }
        /// <summary>
        /// From the serializable.
        /// </summary>
        /// <param name="constantExpressionRepresentation">The constant expression.</param>
        /// <typeparam name="T">Type of constant.</typeparam>
        /// <returns>
        /// Converted expression.
        /// </returns>
        public static ConstantExpression FromRepresentation <T>(
            this ConstantExpressionRepresentation <T> constantExpressionRepresentation)
            where T : ICloneable, IEquatable <T>
        {
            if (constantExpressionRepresentation == null)
            {
                throw new ArgumentNullException(nameof(constantExpressionRepresentation));
            }

            var result = Expression.Constant(constantExpressionRepresentation.Value);

            return(result);
        }
        /// <inheritdoc />
        public bool Equals(ConstantExpressionRepresentation <T> other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

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

            var result = this.NodeType.IsEqualTo(other.NodeType) &&
                         this.Type.IsEqualTo(other.Type) &&
                         this.Value.IsEqualTo(other.Value);

            return(result);
        }