/// <summary> /// Initializes a new instance of the <see cref="DataOutputPath"/> /// struct with the given source parser ID, data cooker ID, and /// output ID. /// </summary> /// <param name="sourceParserId"> /// Source parser Id. /// </param> /// <param name="dataCookerId"> /// Data cooker Id. /// </param> /// <param name="dataOutputId"> /// Data output Id. /// </param> /// <returns> /// DataOutputPath object combined from the given parameters. /// </returns> public static DataOutputPath Create( string sourceParserId, string dataCookerId, string dataOutputId) { Guard.NotNullOrWhiteSpace(dataOutputId, nameof(dataOutputId)); var dataCookerPath = new DataCookerPath(sourceParserId, dataCookerId); return(new DataOutputPath(dataCookerPath, dataOutputId)); }
/// <summary> /// Initializes a new instance of the <see cref="DataOutputPath"/> /// struct with the given cooker path and output ID. /// </summary> /// <param name="cookerPath"> /// Data cooker path. /// </param> /// <param name="outputId"> /// Data output Id. /// </param> public DataOutputPath(DataCookerPath cookerPath, string outputId) { Guard.NotNullOrWhiteSpace(outputId, nameof(outputId)); if (outputId.Contains("/")) { throw new ArgumentException("This value may not contain a '/'.", nameof(outputId)); } this.CookerPath = cookerPath; this.OutputId = string.Intern(outputId); }
/// <summary> /// Generates a data cooker path given a source parser Id and a data cooker Id. /// </summary> /// <param name="sourceParserId"> /// Source parser Id. /// </param> /// <param name="dataCookerId"> /// Data cooker Id. /// </param> /// <param name="dataOutputId"> /// Data output identifier. /// </param> /// <returns> /// The path. /// </returns> public static string Combine(string sourceParserId, string dataCookerId, string dataOutputId) { Guard.NotNullOrWhiteSpace(dataOutputId, nameof(dataOutputId)); return(DataCookerPath.Create(sourceParserId, dataCookerId) + "/" + dataOutputId); }