mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 03:21:37 +00:00
Fixed builders
This commit is contained in:
parent
b781a5ab07
commit
6bb6baced9
@ -1,10 +1,15 @@
|
||||
namespace AIStudio.Tools.MIME;
|
||||
|
||||
public class ApplicationBuilder : Builder, ISubtype
|
||||
public class ApplicationBuilder : ISubtype
|
||||
{
|
||||
private ApplicationBuilder()
|
||||
private readonly BaseType baseType;
|
||||
|
||||
private ApplicationBuilder(BaseType baseType)
|
||||
{
|
||||
this.baseType = baseType;
|
||||
}
|
||||
|
||||
public static ApplicationBuilder Create() => new(BaseType.APPLICATION);
|
||||
|
||||
private ApplicationSubtype subtype;
|
||||
|
||||
|
||||
@ -1,11 +1,16 @@
|
||||
namespace AIStudio.Tools.MIME;
|
||||
|
||||
public class AudioBuilder : Builder, ISubtype
|
||||
public class AudioBuilder : ISubtype
|
||||
{
|
||||
private AudioBuilder()
|
||||
private readonly BaseType baseType;
|
||||
|
||||
private AudioBuilder(BaseType baseType)
|
||||
{
|
||||
this.baseType = baseType;
|
||||
}
|
||||
|
||||
public static AudioBuilder Create() => new(BaseType.AUDIO);
|
||||
|
||||
private AudioSubtype subtype;
|
||||
|
||||
public AudioBuilder UseSubtype(string subType)
|
||||
|
||||
@ -2,11 +2,9 @@ namespace AIStudio.Tools.MIME;
|
||||
|
||||
public class Builder
|
||||
{
|
||||
protected Builder()
|
||||
private Builder()
|
||||
{
|
||||
}
|
||||
|
||||
protected BaseType baseType;
|
||||
|
||||
public static Builder Create() => new();
|
||||
|
||||
@ -48,33 +46,13 @@ public class Builder
|
||||
}
|
||||
}
|
||||
|
||||
public ApplicationBuilder UseApplication()
|
||||
{
|
||||
this.baseType = BaseType.APPLICATION;
|
||||
return (ApplicationBuilder)this;
|
||||
}
|
||||
|
||||
public TextBuilder UseText()
|
||||
{
|
||||
this.baseType = BaseType.TEXT;
|
||||
return (TextBuilder)this;
|
||||
}
|
||||
|
||||
public AudioBuilder UseAudio()
|
||||
{
|
||||
this.baseType = BaseType.AUDIO;
|
||||
return (AudioBuilder)this;
|
||||
}
|
||||
|
||||
public ImageBuilder UseImage()
|
||||
{
|
||||
this.baseType = BaseType.IMAGE;
|
||||
return (ImageBuilder)this;
|
||||
}
|
||||
|
||||
public VideoBuilder UseVideo()
|
||||
{
|
||||
this.baseType = BaseType.VIDEO;
|
||||
return (VideoBuilder)this;
|
||||
}
|
||||
public ApplicationBuilder UseApplication() => ApplicationBuilder.Create();
|
||||
|
||||
public TextBuilder UseText() => TextBuilder.Create();
|
||||
|
||||
public AudioBuilder UseAudio() => AudioBuilder.Create();
|
||||
|
||||
public ImageBuilder UseImage() => ImageBuilder.Create();
|
||||
|
||||
public VideoBuilder UseVideo() => VideoBuilder.Create();
|
||||
}
|
||||
@ -1,11 +1,16 @@
|
||||
namespace AIStudio.Tools.MIME;
|
||||
|
||||
public class ImageBuilder : Builder, ISubtype
|
||||
public class ImageBuilder : ISubtype
|
||||
{
|
||||
private ImageBuilder()
|
||||
private readonly BaseType baseType;
|
||||
|
||||
private ImageBuilder(BaseType baseType)
|
||||
{
|
||||
this.baseType = baseType;
|
||||
}
|
||||
|
||||
public static ImageBuilder Create() => new(BaseType.IMAGE);
|
||||
|
||||
private ImageSubtype subtype;
|
||||
|
||||
public ImageBuilder UseSubtype(string subType)
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
namespace AIStudio.Tools.MIME;
|
||||
|
||||
public class TextBuilder : Builder, ISubtype
|
||||
public class TextBuilder : ISubtype
|
||||
{
|
||||
private TextBuilder()
|
||||
private readonly BaseType baseType;
|
||||
|
||||
private TextBuilder(BaseType baseType)
|
||||
{
|
||||
this.baseType = baseType;
|
||||
}
|
||||
|
||||
public static TextBuilder Create() => new(BaseType.TEXT);
|
||||
|
||||
private TextSubtype subtype;
|
||||
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
namespace AIStudio.Tools.MIME;
|
||||
|
||||
public class VideoBuilder : Builder, ISubtype
|
||||
public class VideoBuilder : ISubtype
|
||||
{
|
||||
private VideoBuilder()
|
||||
private readonly BaseType baseType;
|
||||
|
||||
private VideoBuilder(BaseType baseType)
|
||||
{
|
||||
this.baseType = baseType;
|
||||
}
|
||||
|
||||
public static VideoBuilder Create() => new(BaseType.VIDEO);
|
||||
|
||||
private VideoSubtype subtype;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user