using System.Collections.Generic; using System; /// /// Configuration class which allows users to customize or filter a Waterfall. /// public class WaterfallConfiguration { readonly double? ceiling; readonly double? floor; /// /// Gets the ceiling value. /// public double? Ceiling { get { return ceiling; } } /// /// Gets the floor value. /// public double? Floor { get { return floor; } } /// /// Initializes a new instance of the WaterfallConfiguration class. /// /// The ceiling value. /// The floor value. private WaterfallConfiguration(double? ceiling, double? floor) { this.ceiling = ceiling; this.floor = floor; } /// /// Gets a builder for creating instances of WaterfallConfiguration. /// /// The WaterfallConfigurationBuilder. public static WaterfallConfigurationBuilder Builder() { return new WaterfallConfigurationBuilder(); } /// /// Creates an empty instance of WaterfallConfiguration. /// /// The empty WaterfallConfiguration. public static WaterfallConfiguration Empty() { return new WaterfallConfiguration(double.NaN, double.NaN); } /// /// Builder class which to create a WaterfallConfiguration. /// public class WaterfallConfigurationBuilder { double? ceiling; double? floor; internal WaterfallConfigurationBuilder() {} /// /// Sets the ceiling value. /// /// The ceiling value. /// The WaterfallConfigurationBuilder. public WaterfallConfigurationBuilder SetCeiling(double ceiling) { this.ceiling = ceiling; return this; } /// /// Sets the floor value. /// /// The floor value. /// The WaterfallConfigurationBuilder. public WaterfallConfigurationBuilder SetFloor(double floor) { this.floor = floor; return this; } /// /// Builds an instance of WaterfallConfiguration based on the configured values. /// /// The created WaterfallConfiguration. public WaterfallConfiguration Build() { return new WaterfallConfiguration(ceiling, floor); } } }