@@ -56,6 +56,22 @@ public interface SettingsBuilderRequest {
5656 @ Nonnull
5757 Optional <Source > getGlobalSettingsSource ();
5858
59+ /**
60+ * Gets the project settings source.
61+ *
62+ * @return the project settings source or {@code null} if none
63+ */
64+ @ Nonnull
65+ Optional <Source > getProjectSettingsSource ();
66+
67+ /**
68+ * Gets the project settings path.
69+ *
70+ * @return the project settings path or {@code null} if none
71+ */
72+ @ Nonnull
73+ Optional <Path > getProjectSettingsPath ();
74+
5975 /**
6076 * Gets the user settings path.
6177 *
@@ -75,19 +91,39 @@ public interface SettingsBuilderRequest {
7591 @ Nonnull
7692 static SettingsBuilderRequest build (
7793 @ Nonnull Session session , @ Nonnull Source globalSettingsSource , @ Nonnull Source userSettingsSource ) {
94+ return build (session , globalSettingsSource , null , userSettingsSource );
95+ }
96+
97+ @ Nonnull
98+ static SettingsBuilderRequest build (
99+ @ Nonnull Session session , @ Nonnull Path globalSettingsPath , @ Nonnull Path userSettingsPath ) {
100+ return build (session , globalSettingsPath , null , userSettingsPath );
101+ }
102+
103+ @ Nonnull
104+ static SettingsBuilderRequest build (
105+ @ Nonnull Session session ,
106+ @ Nonnull Source globalSettingsSource ,
107+ @ Nonnull Source projectSettingsSource ,
108+ @ Nonnull Source userSettingsSource ) {
78109 return builder ()
79110 .session (nonNull (session , "session cannot be null" ))
80111 .globalSettingsSource (nonNull (globalSettingsSource , "globalSettingsSource cannot be null" ))
112+ .projectSettingsSource (nonNull (projectSettingsSource , "projectSettingsSource cannot be null" ))
81113 .userSettingsSource (nonNull (userSettingsSource , "userSettingsSource cannot be null" ))
82114 .build ();
83115 }
84116
85117 @ Nonnull
86118 static SettingsBuilderRequest build (
87- @ Nonnull Session session , @ Nonnull Path globalSettingsPath , @ Nonnull Path userSettingsPath ) {
119+ @ Nonnull Session session ,
120+ @ Nonnull Path globalSettingsPath ,
121+ @ Nonnull Path projectSettingsPath ,
122+ @ Nonnull Path userSettingsPath ) {
88123 return builder ()
89124 .session (nonNull (session , "session cannot be null" ))
90125 .globalSettingsPath (nonNull (globalSettingsPath , "globalSettingsPath cannot be null" ))
126+ .projectSettingsPath (nonNull (projectSettingsPath , "projectSettingsPath cannot be null" ))
91127 .userSettingsPath (nonNull (userSettingsPath , "userSettingsPath cannot be null" ))
92128 .build ();
93129 }
@@ -102,6 +138,8 @@ class SettingsBuilderRequestBuilder {
102138 Session session ;
103139 Path globalSettingsPath ;
104140 Source globalSettingsSource ;
141+ Path projectSettingsPath ;
142+ Source projectSettingsSource ;
105143 Path userSettingsPath ;
106144 Source userSettingsSource ;
107145
@@ -120,6 +158,16 @@ public SettingsBuilderRequestBuilder globalSettingsSource(Source globalSettingsS
120158 return this ;
121159 }
122160
161+ public SettingsBuilderRequestBuilder projectSettingsPath (Path projectSettingsPath ) {
162+ this .projectSettingsPath = projectSettingsPath ;
163+ return this ;
164+ }
165+
166+ public SettingsBuilderRequestBuilder projectSettingsSource (Source projectSettingsSource ) {
167+ this .projectSettingsSource = projectSettingsSource ;
168+ return this ;
169+ }
170+
123171 public SettingsBuilderRequestBuilder userSettingsPath (Path userSettingsPath ) {
124172 this .userSettingsPath = userSettingsPath ;
125173 return this ;
@@ -132,12 +180,20 @@ public SettingsBuilderRequestBuilder userSettingsSource(Source userSettingsSourc
132180
133181 public SettingsBuilderRequest build () {
134182 return new DefaultSettingsBuilderRequest (
135- session , globalSettingsPath , globalSettingsSource , userSettingsPath , userSettingsSource );
183+ session ,
184+ globalSettingsPath ,
185+ globalSettingsSource ,
186+ projectSettingsPath ,
187+ projectSettingsSource ,
188+ userSettingsPath ,
189+ userSettingsSource );
136190 }
137191
138192 private static class DefaultSettingsBuilderRequest extends BaseRequest implements SettingsBuilderRequest {
139193 private final Path globalSettingsPath ;
140194 private final Source globalSettingsSource ;
195+ private final Path projectSettingsPath ;
196+ private final Source projectSettingsSource ;
141197 private final Path userSettingsPath ;
142198 private final Source userSettingsSource ;
143199
@@ -146,11 +202,15 @@ private static class DefaultSettingsBuilderRequest extends BaseRequest implement
146202 @ Nonnull Session session ,
147203 @ Nullable Path globalSettingsPath ,
148204 @ Nullable Source globalSettingsSource ,
205+ @ Nullable Path projectSettingsPath ,
206+ @ Nullable Source projectSettingsSource ,
149207 @ Nullable Path userSettingsPath ,
150208 @ Nullable Source userSettingsSource ) {
151209 super (session );
152210 this .globalSettingsPath = globalSettingsPath ;
153211 this .globalSettingsSource = globalSettingsSource ;
212+ this .projectSettingsPath = projectSettingsPath ;
213+ this .projectSettingsSource = projectSettingsSource ;
154214 this .userSettingsPath = userSettingsPath ;
155215 this .userSettingsSource = userSettingsSource ;
156216 }
@@ -167,6 +227,18 @@ public Optional<Source> getGlobalSettingsSource() {
167227 return Optional .ofNullable (globalSettingsSource );
168228 }
169229
230+ @ Nonnull
231+ @ Override
232+ public Optional <Path > getProjectSettingsPath () {
233+ return Optional .ofNullable (projectSettingsPath );
234+ }
235+
236+ @ Nonnull
237+ @ Override
238+ public Optional <Source > getProjectSettingsSource () {
239+ return Optional .ofNullable (projectSettingsSource );
240+ }
241+
170242 @ Nonnull
171243 @ Override
172244 public Optional <Path > getUserSettingsPath () {
0 commit comments