-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BMSPT-24] added project, extensions and documents builder
- Loading branch information
1 parent
ffdf587
commit cf4a311
Showing
38 changed files
with
318 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace bcf.Builder.Bcf21; | ||
|
||
public interface IProjectBuilderExtension<out TBuilder> { | ||
TBuilder AddExtensionSchema(string schema); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace bcf.Builder.Bcf21; | ||
|
||
public interface IVersionBuilderExtension<out TBuilder> { | ||
TBuilder AddDetailedVersion(string version); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using bcf.bcf21; | ||
|
||
namespace bcf.Builder.Bcf21; | ||
|
||
public partial class ProjectBuilder : IProjectBuilder<ProjectBuilder> { | ||
private readonly ProjectExtension _project = new(); | ||
|
||
public ProjectBuilder AddProjectName(string name) { | ||
_project.Project.Name = name; | ||
return this; | ||
} | ||
|
||
public ProjectBuilder AddProjectId(string id) { | ||
_project.Project.ProjectId = id; | ||
return this; | ||
} | ||
|
||
public IProject Build() { | ||
return _project; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace bcf.Builder.Bcf21; | ||
|
||
public partial class ProjectBuilder : IProjectBuilderExtension<ProjectBuilder> { | ||
public ProjectBuilder AddExtensionSchema(string schema) { | ||
_project.ExtensionSchema = schema; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using bcf.bcf21; | ||
|
||
namespace bcf.Builder.Bcf21; | ||
|
||
public partial class VersionBuilder : IVersionBuilder<VersionBuilder> { | ||
private readonly Version _version = new(); | ||
|
||
public VersionBuilder AddVersionId(string id) { | ||
_version.VersionId = id; | ||
return this; | ||
} | ||
|
||
public IVersion Build() { | ||
return _version; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace bcf.Builder.Bcf21; | ||
|
||
public partial class VersionBuilder : IVersionBuilderExtension<VersionBuilder> { | ||
public VersionBuilder AddDetailedVersion(string version) { | ||
_version.DetailedVersion = version; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using bcf.bcf30; | ||
|
||
namespace bcf.Builder.Bcf30; | ||
|
||
public class DocumentBuilder : IDocumentBuilder<DocumentBuilder> { | ||
private readonly Document _document = new(); | ||
|
||
public DocumentBuilder AddGuid(string guid) { | ||
_document.Guid = guid; | ||
return this; | ||
} | ||
|
||
public DocumentBuilder AddFileName(string name) { | ||
_document.Filename = name; | ||
return this; | ||
} | ||
|
||
public DocumentBuilder AddDescription(string description) { | ||
_document.Description = description; | ||
return this; | ||
} | ||
|
||
public IDocument Build() { | ||
return _document; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using bcf.bcf30; | ||
|
||
namespace bcf.Builder.Bcf30; | ||
|
||
public class DocumentInfoBuilder : IDocumentInfoBuilder<DocumentInfoBuilder, DocumentBuilder> { | ||
private readonly DocumentInfo _documentInfo = new(); | ||
|
||
public DocumentInfoBuilder AddDocument(Action<DocumentBuilder> builder) { | ||
var document = | ||
(Document)BuilderUtils.BuildItem<DocumentBuilder, IDocument>(builder); | ||
_documentInfo.Documents.Add(document); | ||
return this; | ||
} | ||
|
||
public IDocumentInfo Build() { | ||
return _documentInfo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using bcf.bcf30; | ||
|
||
namespace bcf.Builder.Bcf30; | ||
|
||
public class ExtensionsBuilder : IExtensionsBuilder<ExtensionsBuilder> { | ||
private readonly Extensions _extensions = new(); | ||
|
||
public ExtensionsBuilder AddTopicType(string type) { | ||
_extensions.TopicTypes.Add(type); | ||
return this; | ||
} | ||
|
||
public ExtensionsBuilder AddTopicStatus(string status) { | ||
_extensions.TopicStatuses.Add(status); | ||
return this; | ||
} | ||
|
||
public ExtensionsBuilder AddPriority(string priority) { | ||
_extensions.Priorities.Add(priority); | ||
return this; | ||
} | ||
|
||
public ExtensionsBuilder AddTopicLabel(string label) { | ||
_extensions.TopicLabels.Add(label); | ||
return this; | ||
} | ||
|
||
public ExtensionsBuilder AddUser(string user) { | ||
_extensions.Users.Add(user); | ||
return this; | ||
} | ||
|
||
public ExtensionsBuilder AddSnippetType(string type) { | ||
_extensions.SnippetTypes.Add(type); | ||
return this; | ||
} | ||
|
||
public ExtensionsBuilder AddStage(string stage) { | ||
_extensions.Stages.Add(stage); | ||
return this; | ||
} | ||
|
||
public IExtensions Build() { | ||
return _extensions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using bcf.bcf30; | ||
|
||
namespace bcf.Builder.Bcf30; | ||
|
||
public class ProjectBuilder : IProjectBuilder<ProjectBuilder> { | ||
private readonly ProjectInfo _project = new(); | ||
|
||
public ProjectBuilder AddProjectName(string name) { | ||
_project.Project.Name = name; | ||
return this; | ||
} | ||
|
||
public ProjectBuilder AddProjectId(string id) { | ||
_project.Project.ProjectId = id; | ||
return this; | ||
} | ||
|
||
public IProject Build() { | ||
return _project; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using bcf.bcf30; | ||
|
||
namespace bcf.Builder.Bcf30; | ||
|
||
public class VersionBuilder : IVersionBuilder<VersionBuilder> { | ||
private readonly Version _version = new(); | ||
|
||
public VersionBuilder AddVersionId(string id) { | ||
_version.VersionId = id; | ||
return this; | ||
} | ||
|
||
public IVersion Build() { | ||
return _version; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace bcf.Builder; | ||
|
||
public interface IDocumentBuilder<out TBuilder> : IBuilder<IDocument> { | ||
TBuilder AddGuid(string guid); | ||
TBuilder AddFileName(string name); | ||
TBuilder AddDescription(string description); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System; | ||
|
||
namespace bcf.Builder; | ||
|
||
public interface IDocumentInfoBuilder<out TBuilder, out TDocumentBuilder> : IBuilder<IDocumentInfo> { | ||
TBuilder AddDocument(Action<TDocumentBuilder> builder); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace bcf.Builder; | ||
|
||
public interface IExtensionsBuilder<out TBuilder> : IBuilder<IExtensions> { | ||
TBuilder AddTopicType(string type); | ||
TBuilder AddTopicStatus(string status); | ||
TBuilder AddPriority(string priority); | ||
TBuilder AddTopicLabel(string label); | ||
TBuilder AddUser(string user); | ||
TBuilder AddSnippetType(string type); | ||
TBuilder AddStage(string stage); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace bcf.Builder; | ||
|
||
public interface IProjectBuilder<out TBuilder> : IBuilder<IProject> { | ||
TBuilder AddProjectName(string name); | ||
TBuilder AddProjectId(string id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace bcf.Builder; | ||
|
||
public interface IVersionBuilder<out TBuilder> : IBuilder<IVersion> { | ||
TBuilder AddVersionId(string id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.