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