Skip to content

Commit 8f257fb

Browse files
author
Zihlu Wang
authored
Merge pull request #25 from OnixByte/development
Migrate group id from cn.org.codecrafters to com.onixbyte
2 parents 9975d25 + 8dd0dad commit 8f257fb

File tree

67 files changed

+682
-629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+682
-629
lines changed

devkit-core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ publishing {
5858
}
5959

6060
scm {
61-
connection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
62-
developerConnection = "scm:git:git://github.com:CodeCraftersCN/JDevKit.git"
61+
connection = "scm:git:git://github.com:OnixByte/JDevKit.git"
62+
developerConnection = "scm:git:git://github.com:OnixByte/JDevKit.git"
6363
url = projectGithubUrl
6464
}
6565

devkit-core/src/main/java/cn/org/codecrafters/devkit/core/exceptions/NotImplementedException.java renamed to devkit-core/src/main/java/com/onixbyte/devkit/core/exceptions/NotImplementedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package cn.org.codecrafters.devkit.core.exceptions;
18+
package com.onixbyte.devkit.core.exceptions;
1919

2020
/**
2121
* The {@code NotImplementedException} class is a custom runtime exception

devkit-core/src/main/java/cn/org/codecrafters/devkit/core/exceptions/package-info.java renamed to devkit-core/src/main/java/com/onixbyte/devkit/core/exceptions/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
* @author Zihlu Wang
2222
* @since 1.0.0
2323
*/
24-
package cn.org.codecrafters.devkit.core.exceptions;
24+
package com.onixbyte.devkit.core.exceptions;

devkit-core/src/main/java/cn/org/codecrafters/devkit/core/package-info.java renamed to devkit-core/src/main/java/com/onixbyte/devkit/core/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
*
4141
* @since 1.0.0
4242
*/
43-
package cn.org.codecrafters.devkit.core;
43+
package com.onixbyte.devkit.core;

devkit-core/src/main/java/cn/org/codecrafters/devkit/package-info.java renamed to devkit-core/src/main/java/com/onixbyte/devkit/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
*
4040
* @since 1.0.0
4141
*/
42-
package cn.org.codecrafters.devkit;
42+
package com.onixbyte.devkit;

devkit-utils/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ implementation 'cn.org.codecrafters:devkit-utils:${devkit-utils.version}'
5151
If you are trying to encode a string to Base64 string or decode a Base64 string to normal string, then you can try this:
5252

5353
```java
54-
import cn.org.codecrafters.devkit.utils.Base64Util;
54+
import utils.com.onixbyte.devkit.Base64Util;
5555

5656
// To reduce sample codes, let me use the simplified main method that is upcoming in Java 21
5757
void main(String... args) {
@@ -68,7 +68,7 @@ void main(String... args) {
6868
I believe those `if...else...` blocks make you headache, and Java imported lambda since Java 8, why not try to replace those `if...else` with lambda expressions?
6969

7070
```java
71-
import cn.org.codecrafters.devkit.utils.BranchUtil;
71+
import utils.com.onixbyte.devkit.BranchUtil;
7272

7373
void main(String... args) {
7474
var a = 1;
@@ -106,7 +106,7 @@ If you have faced high-precision mathematical calculation in Java, you might kno
106106
In Java, we usually do high-precision mathematical calculation with `BigDecimal` which is quite tricky when using it.
107107

108108
```java
109-
import cn.org.codecrafters.devkit.utils.ChainedCalcUtil;
109+
import utils.com.onixbyte.devkit.ChainedCalcUtil;
110110

111111
void main(String... args) {
112112
// If you are trying to calculate the expression of 1 * 2 / 2 - 3 + 4
@@ -133,7 +133,7 @@ This `HashUtil` supports these following hash or message digest algorithms:
133133
If you want to run a hash calculation to a string, you can use the following codes:
134134

135135
```java
136-
import cn.org.codecrafters.devkit.utils.HashUtil;
136+
import utils.com.onixbyte.devkit.HashUtil;
137137

138138
void main(String... args) {
139139
var plaintext = "This is a plain text";
@@ -156,7 +156,7 @@ Imagine you are developing a website where users can register an account and sto
156156
In order to store the Map in a database, you need to convert the Map to an Object. An Object is a generic data type that can store any type of data.
157157

158158
```java
159-
import cn.org.codecrafters.devkit.utils.MapUtil;
159+
import utils.com.onixbyte.devkit.MapUtil;
160160

161161
class Data {
162162
private String name;

devkit-utils/src/main/java/cn/org/codecrafters/devkit/utils/AesUtil.java renamed to devkit-utils/src/main/java/com/onixbyte/devkit/utils/AesUtil.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package cn.org.codecrafters.devkit.utils;
18+
package com.onixbyte.devkit.utils;
1919

2020
import lombok.extern.slf4j.Slf4j;
2121

@@ -44,13 +44,6 @@
4444
@Slf4j
4545
public final class AesUtil {
4646

47-
private AesUtil() {
48-
}
49-
50-
private static final String AES = "AES";
51-
52-
private static final String AES_CBC_CIPHER = "AES/CBC/PKCS5Padding";
53-
5447
/**
5548
* Encrypts the data using the AES algorithm with the given secret.
5649
*
@@ -133,4 +126,20 @@ public static String generateRandomSecret() {
133126
return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16);
134127
}
135128

129+
/**
130+
* Private constructor will protect this class from being instantiated.
131+
*/
132+
private AesUtil() {
133+
}
134+
135+
/**
136+
* The algorithm AES.
137+
*/
138+
private static final String AES = "AES";
139+
140+
/**
141+
* The algorithm AES/CBC/PKCS5Padding.
142+
*/
143+
private static final String AES_CBC_CIPHER = "AES/CBC/PKCS5Padding";
144+
136145
}

devkit-utils/src/main/java/cn/org/codecrafters/devkit/utils/Base64Util.java renamed to devkit-utils/src/main/java/com/onixbyte/devkit/utils/Base64Util.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package cn.org.codecrafters.devkit.utils;
18+
package com.onixbyte.devkit.utils;
1919

2020
import java.nio.charset.Charset;
2121
import java.nio.charset.StandardCharsets;
@@ -56,14 +56,6 @@
5656
*/
5757
public final class Base64Util {
5858

59-
private static Base64.Encoder encoder;
60-
61-
private static Base64.Decoder decoder;
62-
63-
private static Base64.Encoder urlEncoder;
64-
65-
private static Base64.Decoder urlDecoder;
66-
6759
/**
6860
* Ensure that there is only one Base64 Encoder.
6961
*
@@ -210,4 +202,12 @@ public static String decodeUrlComponents(String value) {
210202
return decodeUrlComponents(value, StandardCharsets.UTF_8);
211203
}
212204

205+
private static Base64.Encoder encoder;
206+
207+
private static Base64.Decoder decoder;
208+
209+
private static Base64.Encoder urlEncoder;
210+
211+
private static Base64.Decoder urlDecoder;
212+
213213
}

devkit-utils/src/main/java/cn/org/codecrafters/devkit/utils/BranchUtil.java renamed to devkit-utils/src/main/java/com/onixbyte/devkit/utils/BranchUtil.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package cn.org.codecrafters.devkit.utils;
18+
package com.onixbyte.devkit.utils;
1919

2020
import java.util.Arrays;
2121
import java.util.Objects;
@@ -77,11 +77,6 @@
7777
*/
7878
public final class BranchUtil<T> {
7979

80-
/**
81-
* The final result of the boolean expression.
82-
*/
83-
private final boolean result;
84-
8580
/**
8681
* Create a {@code BranchUtil} instance.
8782
*
@@ -239,4 +234,9 @@ public void handle(Runnable ifHandler) {
239234
handle(ifHandler, null);
240235
}
241236

237+
/**
238+
* The final result of the boolean expression.
239+
*/
240+
private final boolean result;
241+
242242
}

devkit-utils/src/main/java/cn/org/codecrafters/devkit/utils/ChainedCalcUtil.java renamed to devkit-utils/src/main/java/com/onixbyte/devkit/utils/ChainedCalcUtil.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package cn.org.codecrafters.devkit.utils;
18+
package com.onixbyte.devkit.utils;
1919

2020
import lombok.Getter;
2121

@@ -95,12 +95,6 @@
9595
@Getter
9696
public final class ChainedCalcUtil {
9797

98-
/**
99-
* -- GETTER --
100-
* Returns the current value as a BigDecimal.
101-
*/
102-
private BigDecimal value;
103-
10498
/**
10599
* Creates a {@code ChainedCalcUtil} instance with the specified initial
106100
* value.
@@ -359,4 +353,10 @@ private BigDecimal convertBigDecimal(Object value, Integer scale) {
359353
return res;
360354
}
361355

356+
/**
357+
* -- GETTER --
358+
* Returns the current value as a BigDecimal.
359+
*/
360+
private BigDecimal value;
361+
362362
}

0 commit comments

Comments
 (0)