99import java .nio .file .Path ;
1010import java .util .Collections ;
1111import java .util .List ;
12+ import java .util .Objects ;
1213
1314/**
1415 * Configuration of the application. Create instances using {@link #load(Path)}.
@@ -35,40 +36,47 @@ public final class Config {
3536
3637 @ SuppressWarnings ("ConstructorWithTooManyParameters" )
3738 @ JsonCreator (mode = JsonCreator .Mode .PROPERTIES )
38- private Config (@ JsonProperty ("token" ) String token ,
39- @ JsonProperty ("gistApiKey" ) String gistApiKey ,
40- @ JsonProperty ("databasePath" ) String databasePath ,
41- @ JsonProperty ("projectWebsite" ) String projectWebsite ,
42- @ JsonProperty ("discordGuildInvite" ) String discordGuildInvite ,
43- @ JsonProperty ("modAuditLogChannelPattern" ) String modAuditLogChannelPattern ,
44- @ JsonProperty ("mutedRolePattern" ) String mutedRolePattern ,
45- @ JsonProperty ("heavyModerationRolePattern" ) String heavyModerationRolePattern ,
46- @ JsonProperty ("softModerationRolePattern" ) String softModerationRolePattern ,
47- @ JsonProperty ("tagManageRolePattern" ) String tagManageRolePattern ,
48- @ JsonProperty ("suggestions" ) SuggestionsConfig suggestions ,
49- @ JsonProperty ("quarantinedRolePattern" ) String quarantinedRolePattern ,
50- @ JsonProperty ("scamBlocker" ) ScamBlockerConfig scamBlocker ,
51- @ JsonProperty ("wolframAlphaAppId" ) String wolframAlphaAppId ,
52- @ JsonProperty ("helpSystem" ) HelpSystemConfig helpSystem ,
53- @ JsonProperty ("mediaOnlyChannelPattern" ) String mediaOnlyChannelPattern ,
54- @ JsonProperty ("blacklistedFileExtension" ) List <String > blacklistedFileExtension ) {
55- this .token = token ;
56- this .gistApiKey = gistApiKey ;
57- this .databasePath = databasePath ;
58- this .projectWebsite = projectWebsite ;
59- this .discordGuildInvite = discordGuildInvite ;
60- this .modAuditLogChannelPattern = modAuditLogChannelPattern ;
61- this .mutedRolePattern = mutedRolePattern ;
62- this .heavyModerationRolePattern = heavyModerationRolePattern ;
63- this .softModerationRolePattern = softModerationRolePattern ;
64- this .tagManageRolePattern = tagManageRolePattern ;
65- this .suggestions = suggestions ;
66- this .quarantinedRolePattern = quarantinedRolePattern ;
67- this .scamBlocker = scamBlocker ;
68- this .wolframAlphaAppId = wolframAlphaAppId ;
69- this .helpSystem = helpSystem ;
70- this .mediaOnlyChannelPattern = mediaOnlyChannelPattern ;
71- this .blacklistedFileExtension = blacklistedFileExtension ;
39+ private Config (@ JsonProperty (value = "token" , required = true ) String token ,
40+ @ JsonProperty (value = "gistApiKey" , required = true ) String gistApiKey ,
41+ @ JsonProperty (value = "databasePath" , required = true ) String databasePath ,
42+ @ JsonProperty (value = "projectWebsite" , required = true ) String projectWebsite ,
43+ @ JsonProperty (value = "discordGuildInvite" , required = true ) String discordGuildInvite ,
44+ @ JsonProperty (value = "modAuditLogChannelPattern" ,
45+ required = true ) String modAuditLogChannelPattern ,
46+ @ JsonProperty (value = "mutedRolePattern" , required = true ) String mutedRolePattern ,
47+ @ JsonProperty (value = "heavyModerationRolePattern" ,
48+ required = true ) String heavyModerationRolePattern ,
49+ @ JsonProperty (value = "softModerationRolePattern" ,
50+ required = true ) String softModerationRolePattern ,
51+ @ JsonProperty (value = "tagManageRolePattern" ,
52+ required = true ) String tagManageRolePattern ,
53+ @ JsonProperty (value = "suggestions" , required = true ) SuggestionsConfig suggestions ,
54+ @ JsonProperty (value = "quarantinedRolePattern" ,
55+ required = true ) String quarantinedRolePattern ,
56+ @ JsonProperty (value = "scamBlocker" , required = true ) ScamBlockerConfig scamBlocker ,
57+ @ JsonProperty (value = "wolframAlphaAppId" , required = true ) String wolframAlphaAppId ,
58+ @ JsonProperty (value = "helpSystem" , required = true ) HelpSystemConfig helpSystem ,
59+ @ JsonProperty (value = "mediaOnlyChannelPattern" ,
60+ required = true ) String mediaOnlyChannelPattern ,
61+ @ JsonProperty (value = "blacklistedFileExtension" ,
62+ required = true ) List <String > blacklistedFileExtension ) {
63+ this .token = Objects .requireNonNull (token );
64+ this .gistApiKey = Objects .requireNonNull (gistApiKey );
65+ this .databasePath = Objects .requireNonNull (databasePath );
66+ this .projectWebsite = Objects .requireNonNull (projectWebsite );
67+ this .discordGuildInvite = Objects .requireNonNull (discordGuildInvite );
68+ this .modAuditLogChannelPattern = Objects .requireNonNull (modAuditLogChannelPattern );
69+ this .mutedRolePattern = Objects .requireNonNull (mutedRolePattern );
70+ this .heavyModerationRolePattern = Objects .requireNonNull (heavyModerationRolePattern );
71+ this .softModerationRolePattern = Objects .requireNonNull (softModerationRolePattern );
72+ this .tagManageRolePattern = Objects .requireNonNull (tagManageRolePattern );
73+ this .suggestions = Objects .requireNonNull (suggestions );
74+ this .quarantinedRolePattern = Objects .requireNonNull (quarantinedRolePattern );
75+ this .scamBlocker = Objects .requireNonNull (scamBlocker );
76+ this .wolframAlphaAppId = Objects .requireNonNull (wolframAlphaAppId );
77+ this .helpSystem = Objects .requireNonNull (helpSystem );
78+ this .mediaOnlyChannelPattern = Objects .requireNonNull (mediaOnlyChannelPattern );
79+ this .blacklistedFileExtension = Objects .requireNonNull (blacklistedFileExtension );
7280 }
7381
7482 /**
0 commit comments