Skip to content

Commit 89f420a

Browse files
committed
minimise formatting changes pt. 2
1 parent c742ec3 commit 89f420a

File tree

2 files changed

+38
-37
lines changed

2 files changed

+38
-37
lines changed

src/main/java/com/flagsmith/FlagsmithApiWrapper.java

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ public class FlagsmithApiWrapper implements FlagsmithSdk {
4646
/**
4747
* Instantiate with cache.
4848
*
49-
* @param cache cache object
49+
* @param cache cache object
5050
* @param defaultConfig config object
5151
* @param customHeaders custom headers list
52-
* @param logger logger object
53-
* @param apiKey api key
52+
* @param logger logger object
53+
* @param apiKey api key
5454
*/
5555
public FlagsmithApiWrapper(
5656
final FlagsmithCache cache,
5757
final FlagsmithConfig defaultConfig,
5858
final HashMap<String, String> customHeaders,
5959
final FlagsmithLogger logger,
60-
final String apiKey) {
60+
final String apiKey
61+
) {
6162
this(defaultConfig, customHeaders, logger, apiKey);
6263
this.cache = cache;
6364
}
@@ -67,40 +68,43 @@ public FlagsmithApiWrapper(
6768
*
6869
* @param defaultConfig config object
6970
* @param customHeaders custom headers list
70-
* @param logger logger instance
71-
* @param apiKey api key
71+
* @param logger logger instance
72+
* @param apiKey api key
7273
*/
7374
public FlagsmithApiWrapper(
7475
final FlagsmithConfig defaultConfig,
7576
final HashMap<String, String> customHeaders,
7677
final FlagsmithLogger logger,
77-
final String apiKey) {
78+
final String apiKey
79+
) {
7880
this.defaultConfig = defaultConfig;
7981
this.customHeaders = customHeaders;
8082
this.logger = logger;
8183
this.apiKey = apiKey;
8284
requestor = new RequestProcessor(
8385
defaultConfig.getHttpClient(),
8486
logger,
85-
defaultConfig.getRetries());
87+
defaultConfig.getRetries()
88+
);
8689
}
8790

8891
/**
8992
* Instantiate with config, custom headers, logger, apikey and request
9093
* processor.
9194
*
92-
* @param defaultConfig config object
93-
* @param customHeaders custom headers list
94-
* @param logger logger instance
95-
* @param apiKey api key
95+
* @param defaultConfig config object
96+
* @param customHeaders custom headers list
97+
* @param logger logger instance
98+
* @param apiKey api key
9699
* @param requestProcessor request processor
97100
*/
98101
public FlagsmithApiWrapper(
99-
final FlagsmithConfig defaultConfig,
100-
final HashMap<String, String> customHeaders,
101-
final FlagsmithLogger logger,
102-
final String apiKey,
103-
final RequestProcessor requestProcessor) {
102+
final FlagsmithConfig defaultConfig,
103+
final HashMap<String, String> customHeaders,
104+
final FlagsmithLogger logger,
105+
final String apiKey,
106+
final RequestProcessor requestProcessor
107+
) {
104108
this.defaultConfig = defaultConfig;
105109
this.customHeaders = customHeaders;
106110
this.logger = logger;
@@ -129,13 +133,14 @@ public Flags getFeatureFlags(boolean doThrow) {
129133

130134
Future<List<FeatureStateModel>> featureFlagsFuture = requestor.executeAsync(
131135
request,
132-
new TypeReference<List<FeatureStateModel>>() {
133-
},
134-
doThrow);
136+
new TypeReference<List<FeatureStateModel>>() {},
137+
doThrow
138+
);
135139

136140
try {
137141
List<FeatureStateModel> featureFlagsResponse = featureFlagsFuture.get(
138-
TIMEOUT, TimeUnit.MILLISECONDS);
142+
TIMEOUT, TimeUnit.MILLISECONDS
143+
);
139144

140145
if (featureFlagsResponse == null) {
141146
featureFlagsResponse = new ArrayList<>();
@@ -202,17 +207,17 @@ public Flags identifyUserWithTraits(
202207

203208
Future<FlagsAndTraitsResponse> featureFlagsFuture = requestor.executeAsync(
204209
request,
205-
new TypeReference<FlagsAndTraitsResponse>() {
206-
},
207-
doThrow);
210+
new TypeReference<FlagsAndTraitsResponse>() {},
211+
doThrow
212+
);
208213

209214
try {
210215
FlagsAndTraitsResponse flagsAndTraitsResponse = featureFlagsFuture.get(
211-
TIMEOUT, TimeUnit.MILLISECONDS);
216+
TIMEOUT, TimeUnit.MILLISECONDS
217+
);
212218
List<FeatureStateModel> flagsArray = flagsAndTraitsResponse != null
213219
&& flagsAndTraitsResponse.getFlags() != null
214-
? flagsAndTraitsResponse.getFlags()
215-
: new ArrayList<>();
220+
? flagsAndTraitsResponse.getFlags() : new ArrayList<>();
216221

217222
flags = Flags.fromApiFlags(
218223
flagsArray,
@@ -246,8 +251,7 @@ public EvaluationContext getEvaluationContext() {
246251
final Request request = newGetRequest(defaultConfig.getEnvironmentUri());
247252

248253
Future<JsonNode> environmentFuture = requestor.executeAsync(request,
249-
new TypeReference<JsonNode>() {
250-
},
254+
new TypeReference<JsonNode>() {},
251255
Boolean.TRUE);
252256

253257
try {

src/main/java/com/flagsmith/flagengine/utils/types/TypeCasting.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,14 @@ public static Boolean isSemver(Object str) {
180180
}
181181

182182
/**
183-
* Modulo is a special case as the condition value holds both the divisor and
184-
* remainder.
185-
* This method compares the conditionValue and the traitValue by dividing the
186-
* traitValue
183+
* Modulo is a special case as the condition value holds both the divisor and remainder.
184+
* This method compares the conditionValue and the traitValue by dividing the traitValue
187185
* by the divisor and verifying that it correctly equals the remainder.
188186
*
189187
* @param conditionValue conditionValue in the format 'divisor|remainder'
190-
* @param traitValue the value of the matched trait
191-
* @return true if expression evaluates to true, false if unable to evaluate
192-
* expression or
193-
* it evaluates to false
188+
* @param traitValue the value of the matched trait
189+
* @return true if expression evaluates to true, false if unable to evaluate expression or
190+
* it evaluates to false
194191
*/
195192
public static Boolean compareModulo(String conditionValue, Object traitValue) {
196193
try {

0 commit comments

Comments
 (0)