Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.

Commit 4d5629d

Browse files
committed
util
1 parent 90673c6 commit 4d5629d

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2022 Enaium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package cn.enaium.joe.util;
18+
19+
import java.awt.*;
20+
21+
/**
22+
* @author Enaium
23+
* @since 0.5.0
24+
*/
25+
public class HtmlUtil {
26+
public static String toHtml(String text) {
27+
return String.format("<html>%s</html>", text);
28+
}
29+
30+
public static String setColor(String text, Color color) {
31+
return String.format("<font color=rgb(%d,%d,%d)>%s</font>", color.getRed(), color.getGreen(), color.getBlue(), text);
32+
}
33+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2022 Enaium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package cn.enaium.joe.util;
18+
19+
/**
20+
* @author Enaium
21+
* @since 0.5.0
22+
*/
23+
public class StringUtil {
24+
public static boolean isBlank(String string) {
25+
return string.replace(" ", "").isEmpty();
26+
}
27+
}

0 commit comments

Comments
 (0)