Skip to content

Commit 3f9eecf

Browse files
authored
Merge pull request #1 from formkiq/v1.1
Added support for <classname>::<method> format and spotless formatting
2 parents 1694483 + 21a77b7 commit 3f9eecf

16 files changed

+301
-276
lines changed

build.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ plugins {
22
id 'java-library'
33
id 'maven-publish'
44
id 'signing'
5+
id "com.diffplug.gradle.spotless" version "4.3.0"
56
}
67

78
group = 'com.formkiq'
8-
version = '1.0'
9+
version = '1.1'
910

1011
sourceCompatibility = JavaVersion.VERSION_1_8
1112
targetCompatibility = JavaVersion.VERSION_1_8
@@ -25,6 +26,12 @@ java {
2526
withSourcesJar()
2627
}
2728

29+
spotless {
30+
java {
31+
googleJavaFormat()
32+
}
33+
}
34+
2835
publishing {
2936
publications {
3037
mavenJava(MavenPublication) {

src/main/java/com/formkiq/lambda/runtime/graalvm/HttpClient.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Copyright [2020] FormKiQ Inc. Licensed under the Apache License, Version 2.0 (the "License"); you
33
* may not use this file except in compliance with the License. You may obtain a copy of the License
44
* at
5-
*
6-
* http://www.apache.org/licenses/LICENSE-2.0
7-
*
8-
* Unless required by applicable law or agreed to in writing, software distributed under the License
9-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10-
* or implied. See the License for the specific language governing permissions and limitations under
11-
* the License.
5+
*
6+
* <p>http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
9+
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
10+
* express or implied. See the License for the specific language governing permissions and
11+
* limitations under the License.
1212
*/
1313
package com.formkiq.lambda.runtime.graalvm;
1414

@@ -20,15 +20,12 @@
2020
import java.net.URL;
2121
import java.nio.charset.StandardCharsets;
2222

23-
/**
24-
* Http Service using the build in Java {@link HttpURLConnection} library.
25-
*
26-
*/
23+
/** Http Service using the build in Java {@link HttpURLConnection} library. */
2724
public class HttpClient {
2825

2926
/**
3027
* Send 'Get' request.
31-
*
28+
*
3229
* @param url {@link String}
3330
* @return {@link HttpResponse}
3431
* @throws IOException IOException
@@ -43,7 +40,7 @@ public static HttpResponse get(final String url) throws IOException {
4340

4441
/**
4542
* Build {@link HttpResponse} from {@link HttpURLConnection}.
46-
*
43+
*
4744
* @param conn {@link HttpURLConnection}
4845
* @return {@link HttpResponse}
4946
* @throws IOException IOException
@@ -52,11 +49,14 @@ private static HttpResponse buildResponse(final HttpURLConnection conn) throws I
5249

5350
HttpResponse response = new HttpResponse(conn.getResponseCode());
5451

55-
conn.getHeaderFields().entrySet().forEach(e -> {
56-
if (e.getKey() != null && e.getValue() != null) {
57-
response.addHeader(e.getKey(), e.getValue());
58-
}
59-
});
52+
conn.getHeaderFields()
53+
.entrySet()
54+
.forEach(
55+
e -> {
56+
if (e.getKey() != null && e.getValue() != null) {
57+
response.addHeader(e.getKey(), e.getValue());
58+
}
59+
});
6060

6161
StringBuilder sb = new StringBuilder();
6262
BufferedReader br =

src/main/java/com/formkiq/lambda/runtime/graalvm/HttpResponse.java

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Copyright [2020] FormKiQ Inc. Licensed under the Apache License, Version 2.0 (the "License"); you
33
* may not use this file except in compliance with the License. You may obtain a copy of the License
44
* at
5-
*
6-
* http://www.apache.org/licenses/LICENSE-2.0
7-
*
8-
* Unless required by applicable law or agreed to in writing, software distributed under the License
9-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10-
* or implied. See the License for the specific language governing permissions and limitations under
11-
* the License.
5+
*
6+
* <p>http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
9+
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
10+
* express or implied. See the License for the specific language governing permissions and
11+
* limitations under the License.
1212
*/
1313
package com.formkiq.lambda.runtime.graalvm;
1414

@@ -19,10 +19,7 @@
1919
import java.util.Map.Entry;
2020
import java.util.Optional;
2121

22-
/**
23-
* HttpResponse.
24-
*
25-
*/
22+
/** HttpResponse. */
2623
public class HttpResponse {
2724

2825
/** HTTP Status Code. */
@@ -34,16 +31,14 @@ public class HttpResponse {
3431
/** HTTP Headers. */
3532
private Map<String, List<String>> headers;
3633

37-
/**
38-
* constructor.
39-
*/
34+
/** constructor. */
4035
public HttpResponse() {
4136
this.headers = new HashMap<>();
4237
}
4338

4439
/**
4540
* constructor.
46-
*
41+
*
4742
* @param status int
4843
*/
4944
public HttpResponse(final int status) {
@@ -53,7 +48,7 @@ public HttpResponse(final int status) {
5348

5449
/**
5550
* Get HTTP Status Code.
56-
*
51+
*
5752
* @return int
5853
*/
5954
public int getStatusCode() {
@@ -62,7 +57,7 @@ public int getStatusCode() {
6257

6358
/**
6459
* Set HTTP Status Code.
65-
*
60+
*
6661
* @param status int
6762
*/
6863
public void setStatusCode(final int status) {
@@ -71,7 +66,7 @@ public void setStatusCode(final int status) {
7166

7267
/**
7368
* Get HTTP Headers.
74-
*
69+
*
7570
* @return {@link Map}
7671
*/
7772
public Map<String, List<String>> getHeaders() {
@@ -80,7 +75,7 @@ public Map<String, List<String>> getHeaders() {
8075

8176
/**
8277
* Set HTTP Headers.
83-
*
78+
*
8479
* @param httpHeaders {@link Map}
8580
*/
8681
public void setHeaders(final Map<String, List<String>> httpHeaders) {
@@ -89,7 +84,7 @@ public void setHeaders(final Map<String, List<String>> httpHeaders) {
8984

9085
/**
9186
* Add HTTP Header.
92-
*
87+
*
9388
* @param key {@link String}
9489
* @param values {@link List}
9590
*/
@@ -99,7 +94,7 @@ public void addHeader(final String key, final List<String> values) {
9994

10095
/**
10196
* Get HTTP Body.
102-
*
97+
*
10398
* @return {@link String}
10499
*/
105100
public String getBody() {
@@ -108,7 +103,7 @@ public String getBody() {
108103

109104
/**
110105
* Set HTTP Body.
111-
*
106+
*
112107
* @param httpbody {@link String}
113108
*/
114109
public void setBody(final String httpbody) {
@@ -117,7 +112,7 @@ public void setBody(final String httpbody) {
117112

118113
/**
119114
* Get Header Values.
120-
*
115+
*
121116
* @param key {@link String}
122117
* @return {@link List}
123118
*/
@@ -129,7 +124,7 @@ public List<String> getHeaderValues(final String key) {
129124

130125
/**
131126
* Get Header Value.
132-
*
127+
*
133128
* @param key {@link String}
134129
* @return {@link List}
135130
*/

src/main/java/com/formkiq/lambda/runtime/graalvm/LambdaContext.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Copyright [2020] FormKiQ Inc. Licensed under the Apache License, Version 2.0 (the "License"); you
33
* may not use this file except in compliance with the License. You may obtain a copy of the License
44
* at
5-
*
6-
* http://www.apache.org/licenses/LICENSE-2.0
7-
*
8-
* Unless required by applicable law or agreed to in writing, software distributed under the License
9-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10-
* or implied. See the License for the specific language governing permissions and limitations under
11-
* the License.
5+
*
6+
* <p>http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
9+
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
10+
* express or implied. See the License for the specific language governing permissions and
11+
* limitations under the License.
1212
*/
1313
package com.formkiq.lambda.runtime.graalvm;
1414

@@ -17,10 +17,7 @@
1717
import com.amazonaws.services.lambda.runtime.Context;
1818
import com.amazonaws.services.lambda.runtime.LambdaLogger;
1919

20-
/**
21-
* Implementation of {@link Context}.
22-
*
23-
*/
20+
/** Implementation of {@link Context}. */
2421
public class LambdaContext implements Context {
2522

2623
/** AWS Request Id. */
@@ -30,7 +27,7 @@ public class LambdaContext implements Context {
3027

3128
/**
3229
* constructor.
33-
*
30+
*
3431
* @param requestId {@link String}
3532
*/
3633
public LambdaContext(final String requestId) {

src/main/java/com/formkiq/lambda/runtime/graalvm/LambdaLoggerSystemOut.java

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22
* Copyright [2020] FormKiQ Inc. Licensed under the Apache License, Version 2.0 (the "License"); you
33
* may not use this file except in compliance with the License. You may obtain a copy of the License
44
* at
5-
*
6-
* http://www.apache.org/licenses/LICENSE-2.0
7-
*
8-
* Unless required by applicable law or agreed to in writing, software distributed under the License
9-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10-
* or implied. See the License for the specific language governing permissions and limitations under
11-
* the License.
5+
*
6+
* <p>http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
9+
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
10+
* express or implied. See the License for the specific language governing permissions and
11+
* limitations under the License.
1212
*/
1313
package com.formkiq.lambda.runtime.graalvm;
1414

15-
import java.io.IOException;
1615
import com.amazonaws.services.lambda.runtime.LambdaLogger;
16+
import java.io.IOException;
1717

18-
/**
19-
* Implementation of {@link LambdaLogger}.
20-
*
21-
*/
18+
/** Implementation of {@link LambdaLogger}. */
2219
public class LambdaLoggerSystemOut implements LambdaLogger {
2320

2421
@Override

0 commit comments

Comments
 (0)