Skip to content

Commit b26900b

Browse files
chore: update gradle plugin, some code style changes (#7)
1 parent 598a028 commit b26900b

13 files changed

+75
-97
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ repositories {
3434
}
3535

3636
dependencies {
37-
compileOnly("net.deltapvp:http4j:1.5.0-SNAPSHOT")
37+
compileOnly("net.deltapvp:http4j:1.5.1-SNAPSHOT")
3838
}
3939
```
4040

4141
```xml
4242
<dependency>
4343
<groupId>net.deltapvp</groupId>
4444
<artifactId>http4j</artifactId>
45-
<version>1.5.0-SNAPSHOT</version>
45+
<version>1.5.1-SNAPSHOT</version>
4646
</dependency>
4747
```
4848

4949
### Code
5050

51-
**JavaDocs:** [https://javadoc.io/doc/net.deltapvp/http4j](https://javadoc.io/doc/net.deltapvp/http4j)
51+
**JavaDocs:** [https://reposilite.deltapvp.net/javadoc/snapshots/net/deltapvp/http4j/1.5.1-SNAPSHOT](https://reposilite.deltapvp.net/javadoc/snapshots/net/deltapvp/http4j/1.5.1-SNAPSHOT)
5252

5353
All requests are done using an instance of `com.intellectualsites.http.HttpClient`:
5454

build.gradle

+2-20
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ repositories {
1313
maven {
1414
url("https://repo.deltapvp.net/")
1515
}
16-
maven {
17-
url("https://maven.reposilite.com/snapshots")
18-
}
19-
maven {
20-
url("https://repository.apache.org/snapshots")
21-
}
22-
mavenLocal()
2316
}
2417

2518
dependencies {
@@ -38,18 +31,6 @@ test {
3831
useJUnitPlatform()
3932
}
4033

41-
//javadoc {
42-
// title = project.name + " " + project.version
43-
// options.addStringOption("Xdoclint:none", "-quiet")
44-
// options.tags(
45-
// "apiNote:a:API Note:",
46-
// "implSpec:a:Implementation Requirements:",
47-
// "implNote:a:Implementation Note:"
48-
// )
49-
// options.links("https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/")
50-
// options.links("https://www.javadoc.io/doc/com.google.code.gson/gson/2.9.1/")
51-
//}
52-
5334
indra {
5435
javaVersions {
5536
minimumToolchain(8)
@@ -67,7 +48,8 @@ indra {
6748
developers {
6849
developer {
6950
id = "powercas_gamer"
70-
timezone = "America/Chicago"
51+
name = "Cas"
52+
timezone = "Europe/Amsterdam"
7153
}
7254
developer {
7355
id = "Citymonstret"

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ kapt.use.worker.api=true
2121
kapt.incremental.apt=true
2222
titan.major = 1
2323
titan.minor = 5
24-
titan.patch = 0
24+
titan.patch = 1
2525
titan.build = 0
2626
titan.include-build = false
2727
titan.status = -SNAPSHOT

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
indra = "3.0.1"
33
annotations = "23.0.0"
44
gson = "2.10"
5-
titan = "1.0.65-SNAPSHOT"
5+
titan = "1.0.85-SNAPSHOT"
66

77
[libraries]
88
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }

settings.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ pluginManagement {
22
repositories {
33
mavenCentral()
44
gradlePluginPortal()
5-
maven("https://repo.stellardrift.ca/repository/snapshots/")
65
maven("https://repo.deltapvp.net/")
7-
mavenLocal()
86
}
97
}
108

src/main/java/com/intellectualsites/http/ContentType.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private ContentType(@NotNull final String type) {
5454
* @param type MIME type
5555
* @return MIME type instance
5656
*/
57-
@NotNull public static ContentType of(@NotNull final String type) {
57+
public static @NotNull ContentType of(@NotNull final String type) {
5858
return internalMap.computeIfAbsent(Objects.requireNonNull(type,
5959
"Type may not be null").toLowerCase(), ContentType::new);
6060
}
@@ -74,11 +74,11 @@ public boolean equals(@Nullable final Object o) {
7474
if (this == o) {
7575
return true;
7676
}
77-
if (o == null || getClass() != o.getClass()) {
77+
if (o == null || this.getClass() != o.getClass()) {
7878
return false;
7979
}
8080
final ContentType mimeType = (ContentType) o;
81-
return Objects.equals(type, mimeType.type);
81+
return Objects.equals(this.type, mimeType.type);
8282
}
8383

8484
}

src/main/java/com/intellectualsites/http/EntityMapper.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static <T> T castUnsafe(@NotNull final Object o) {
5050
*
5151
* @return Created instance
5252
*/
53-
@NotNull public static EntityMapper newInstance() {
53+
public static @NotNull EntityMapper newInstance() {
5454
final EntityMapper mapper = new EntityMapper();
5555
mapper.registerDeserializer(String.class, new StringDeserializer());
5656
mapper.registerSerializer(String.class, new StringSerializer());
@@ -65,8 +65,8 @@ private static <T> T castUnsafe(@NotNull final Object o) {
6565
* @param <T> Type to map
6666
* @return Mapper instance
6767
*/
68-
@NotNull public <T> EntityMapper registerSerializer(@NotNull final Class<T> clazz,
69-
@NotNull final EntitySerializer<T> serializer) {
68+
public @NotNull <T> EntityMapper registerSerializer(@NotNull final Class<T> clazz,
69+
@NotNull final EntitySerializer<T> serializer) {
7070
Objects.requireNonNull(clazz, "Class may not be null");
7171
Objects.requireNonNull(serializer, "Serializer may not be null");
7272
this.serializers.put(clazz, serializer);
@@ -81,7 +81,7 @@ private static <T> T castUnsafe(@NotNull final Object o) {
8181
* @param <T> Type of the objects produces by the deserializer
8282
* @return Mapper instance
8383
*/
84-
@NotNull public <T> EntityMapper registerDeserializer(@NotNull final Class<T> clazz,
84+
public @NotNull <T> EntityMapper registerDeserializer(@NotNull final Class<T> clazz,
8585
@NotNull final EntityDeserializer<T> deserializer) {
8686
Objects.requireNonNull(clazz, "Type may not be null");
8787
Objects.requireNonNull(deserializer, "Deserializer may not be null");
@@ -145,7 +145,6 @@ public interface EntitySerializer<T> {
145145

146146
}
147147

148-
149148
/**
150149
* Deserializer for HTTP response bodies
151150
*
@@ -166,11 +165,10 @@ public interface EntityDeserializer<T> {
166165

167166
}
168167

169-
170168
private static final class StringDeserializer implements EntityDeserializer<String> {
171169

172-
@NotNull @Override
173-
public String deserialize(@Nullable final ContentType contentType,
170+
@Override
171+
public @NotNull String deserialize(@Nullable final ContentType contentType,
174172
final byte @NotNull [] input) {
175173
final Charset charset;
176174
if (contentType != null && contentType.toString().toLowerCase().contains("utf-8")) {
@@ -200,5 +198,4 @@ public ContentType getContentType() {
200198
}
201199

202200
}
203-
204201
}

src/main/java/com/intellectualsites/http/Headers.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void addHeader(@NotNull String key, @NotNull final String value) {
8989
* @return Header value, or {@code ""}
9090
*/
9191
@NotNull String getHeader(@NotNull final String key) {
92-
return Objects.requireNonNull(getOrDefault(key, ""));
92+
return Objects.requireNonNull(this.getOrDefault(key, ""));
9393
}
9494

9595
/**

0 commit comments

Comments
 (0)