Skip to content
This repository was archived by the owner on Nov 21, 2020. It is now read-only.

Commit 30812b0

Browse files
committed
fix: class comment format
1 parent 2b9b18d commit 30812b0

File tree

68 files changed

+85
-85
lines changed

Some content is hidden

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

68 files changed

+85
-85
lines changed

src/main/java/org/code4everything/boot/base/DateUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @author pantao
1111
* @since 2019/3/22
12-
**/
12+
*/
1313
public final class DateUtils {
1414

1515
// -------------------当天--------------------------------

src/main/java/org/code4everything/boot/base/FileUtils.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
import cn.hutool.core.io.watch.Watcher;
88
import cn.hutool.core.io.watch.watchers.DelayWatcher;
99
import cn.hutool.core.util.CharsetUtil;
10+
import com.alibaba.fastjson.JSON;
1011
import com.alibaba.fastjson.JSONObject;
12+
import org.code4everything.boot.base.bean.BaseBean;
1113
import org.code4everything.boot.base.constant.StringConsts;
1214
import org.code4everything.boot.config.BootConfig;
1315
import org.code4everything.boot.config.BootConfigProperties;
@@ -25,7 +27,7 @@
2527
*
2628
* @author pantao
2729
* @since 2018/11/2
28-
**/
30+
*/
2931
public final class FileUtils {
3032

3133
private static final Logger LOGGER = LoggerFactory.getLogger(FileUtils.class);
@@ -88,15 +90,22 @@ public static <T> void watchFile(String jsonFile, FileWatcher fileWatcher, T con
8890
Objects.requireNonNull(config, "the object 'config' must not be null");
8991
watchFile(jsonFile, new FileWatcher() {
9092

93+
// 是否实现了基类
94+
private boolean isBase = config instanceof BaseBean;
95+
9196
// 是否设置访问拦截名单
92-
private boolean notSet = config instanceof FilterPath;
97+
private boolean notSet = isBase && config instanceof FilterPath;
9398

9499
@Override
95100
public void doSomething() {
96101
// 解析JSON文件
97-
JSONObject root = JSONObject.parseObject(FileUtil.readString(jsonFile, charset));
102+
JSONObject root = JSON.parseObject(FileUtil.readString(jsonFile, charset));
98103
// 属性复制
99104
BeanUtil.copyProperties(root.toJavaObject(config.getClass()), config);
105+
if (isBase) {
106+
// 对NULL进行默认赋值(需实现nulls2Default方法)
107+
((BaseBean) config).nulls2Default();
108+
}
100109
// 解析BootSurface配置
101110
if (root.containsKey(StringConsts.BOOT)) {
102111
BootConfig.setConfig(root.getObject(StringConsts.BOOT, BootConfigProperties.class));

src/main/java/org/code4everything/boot/base/ListUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author pantao
99
* @since 2019/5/6
10-
**/
10+
*/
1111
public final class ListUtils {
1212

1313
private ListUtils() {}

src/main/java/org/code4everything/boot/base/MapUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* @author pantao
1313
* @since 2019/4/19
14-
**/
14+
*/
1515
public final class MapUtils {
1616

1717
private MapUtils() {}

src/main/java/org/code4everything/boot/base/ObjectUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @author pantao
1212
* @since 2019/4/17
13-
**/
13+
*/
1414
public final class ObjectUtils {
1515

1616
private ObjectUtils() {}

src/main/java/org/code4everything/boot/base/ReferenceUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @author pantao
1010
* @since 2019/6/26
11-
**/
11+
*/
1212
public class ReferenceUtils {
1313

1414
private ReferenceUtils() {}

src/main/java/org/code4everything/boot/base/bean/BaseBean.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@
1313
*
1414
* @author pantao
1515
* @since 2019/1/11
16-
**/
16+
*/
1717
public interface BaseBean {
1818

19+
/**
20+
* 将空指针的属性设为默认值
21+
*
22+
* @since 1.1.6
23+
*/
24+
default void nulls2Default() {}
25+
1926
/**
2027
* 比较对象是否相等,快速失败
2128
*

src/main/java/org/code4everything/boot/base/bean/BaseDomain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author pantao
99
* @since 2019/5/10
10-
**/
10+
*/
1111
public interface BaseDomain extends BaseBean, Serializable {
1212

1313
/**

src/main/java/org/code4everything/boot/base/bean/WeePage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @author pantao
1717
* @since 2019/3/20
18-
**/
18+
*/
1919
public class WeePage<T> implements BaseBean, Serializable {
2020

2121
private static final long serialVersionUID = -7558939772837583007L;

src/main/java/org/code4everything/boot/base/collection/SortedList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @author pantao
1717
* @since 2019/1/17
18-
**/
18+
*/
1919
@NotThreadSafe
2020
public class SortedList<E, T extends List<E>> implements BaseBean {
2121

src/main/java/org/code4everything/boot/base/constant/IntegerConsts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2018/11/2
8-
**/
8+
*/
99
public final class IntegerConsts {
1010

1111
public static final int ONE_THOUSAND_AND_TWENTY_FOUR = 1024;

src/main/java/org/code4everything/boot/base/constant/StringConsts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2018/10/31
8-
**/
8+
*/
99
public final class StringConsts {
1010

1111
public static final String TOKEN = "token";

src/main/java/org/code4everything/boot/base/encoder/DefaultFieldEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author pantao
1818
* @since 2018/11/11
19-
**/
19+
*/
2020
public class DefaultFieldEncoder implements FieldEncoder {
2121

2222
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFieldEncoder.class);

src/main/java/org/code4everything/boot/base/encoder/FieldEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2019/4/2
8-
**/
8+
*/
99
@FunctionalInterface
1010
public interface FieldEncoder {
1111

src/main/java/org/code4everything/boot/base/encoder/Sealed.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @author pantao
1212
* @since 2018/11/11
13-
**/
13+
*/
1414
@Documented
1515
@Target(ElementType.FIELD)
1616
@Retention(RetentionPolicy.RUNTIME)

src/main/java/org/code4everything/boot/base/function/BooleanFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2018/12/26
8-
**/
8+
*/
99
@FunctionalInterface
1010
public interface BooleanFunction {
1111

src/main/java/org/code4everything/boot/base/function/StringFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2018/12/29
8-
**/
8+
*/
99
@FunctionalInterface
1010
public interface StringFunction {
1111

src/main/java/org/code4everything/boot/base/function/TypeFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2018/12/29
8-
**/
8+
*/
99
@FunctionalInterface
1010
public interface TypeFunction<T> {
1111

src/main/java/org/code4everything/boot/base/function/VoidFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2018/12/27
8-
**/
8+
*/
99
@FunctionalInterface
1010
public interface VoidFunction {
1111

src/main/java/org/code4everything/boot/cache/AbstractCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* @author pantao
1212
* @since 2019/6/14
13-
**/
13+
*/
1414
public abstract class AbstractCache implements Cache {
1515

1616
private final String name;

src/main/java/org/code4everything/boot/cache/BootCacheManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @author pantao
2323
* @since 2019/6/13
24-
**/
24+
*/
2525
public class BootCacheManager implements CacheManager {
2626

2727
/**

src/main/java/org/code4everything/boot/cache/CacheCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author pantao
99
* @since 2019/6/13
10-
**/
10+
*/
1111
@FunctionalInterface
1212
public interface CacheCreator {
1313

src/main/java/org/code4everything/boot/cache/CacheRemovable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @author pantao
77
* @since 2019/6/18
8-
**/
8+
*/
99
@FunctionalInterface
1010
public interface CacheRemovable<T> {
1111

src/main/java/org/code4everything/boot/cache/CacheUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author pantao
1818
* @since 2019/6/13
19-
**/
19+
*/
2020
public class CacheUtils {
2121

2222
private CacheUtils() {}

src/main/java/org/code4everything/boot/cache/guava/GuavaCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* @author pantao
1313
* @since 2019/6/13
14-
**/
14+
*/
1515
public class GuavaCache extends AbstractCache {
1616

1717
/**

src/main/java/org/code4everything/boot/cache/guava/GuavaCacheCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @author pantao
1212
* @since 2019/6/13
13-
**/
13+
*/
1414
public class GuavaCacheCreator implements CacheCreator {
1515

1616
/**

src/main/java/org/code4everything/boot/cache/guava/GuavaCacheManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* @author pantao
1313
* @since 2019/6/13
14-
**/
14+
*/
1515
public class GuavaCacheManager extends BootCacheManager {
1616

1717
public GuavaCacheManager(CacheBuilder<Object, Object> cacheBuilder) {

src/main/java/org/code4everything/boot/config/BootConfigProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author pantao
77
* @since 2019/4/16
8-
**/
8+
*/
99
@ConfigurationProperties("boot.surface")
1010
public class BootConfigProperties {
1111

src/main/java/org/code4everything/boot/config/BootConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @author pantao
99
* @since 2019/4/16
10-
**/
10+
*/
1111
@Configuration
1212
@EnableConfigurationProperties(BootConfigProperties.class)
1313
public class BootConfiguration {

src/main/java/org/code4everything/boot/config/BootMailConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* @author pantao
1111
* @since 2019/4/16
12-
**/
12+
*/
1313
@Configuration
1414
@ConditionalOnClass(JavaMailSender.class)
1515
public class BootMailConfiguration {

src/main/java/org/code4everything/boot/config/BootRedisConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* @author pantao
1010
* @since 2019/4/16
11-
**/
11+
*/
1212
@Configuration
1313
@ConditionalOnClass(RedisConnectionFactory.class)
1414
public class BootRedisConfiguration {

src/main/java/org/code4everything/boot/config/EnableSurfaceConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @author pantao
99
* @since 2019/4/16
10-
**/
10+
*/
1111
@Target({ElementType.TYPE})
1212
@Retention(RetentionPolicy.RUNTIME)
1313
@Documented

src/main/java/org/code4everything/boot/config/EnableSurfaceLog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @author pantao
99
* @since 2019/4/16
10-
**/
10+
*/
1111
@Target({ElementType.TYPE})
1212
@Retention(RetentionPolicy.RUNTIME)
1313
@Documented

src/main/java/org/code4everything/boot/config/EnableSurfaceMail.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @author pantao
99
* @since 2019/4/16
10-
**/
10+
*/
1111
@Target({ElementType.TYPE})
1212
@Retention(RetentionPolicy.RUNTIME)
1313
@Documented

src/main/java/org/code4everything/boot/config/EnableSurfaceRedis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @author pantao
99
* @since 2019/4/16
10-
**/
10+
*/
1111
@Target({ElementType.TYPE})
1212
@Retention(RetentionPolicy.RUNTIME)
1313
@Documented

src/main/java/org/code4everything/boot/log/LogMethod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @author pantao
99
* @since 2018/10/30
10-
**/
10+
*/
1111
@Documented
1212
@Target(ElementType.METHOD)
1313
@Retention(RetentionPolicy.RUNTIME)

src/main/java/org/code4everything/boot/message/MailCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @author pantao
77
* @since 2019/3/22
8-
**/
8+
*/
99
public interface MailCallback {
1010

1111
/**

src/main/java/org/code4everything/boot/message/MailUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* @author pantao
1616
* @since 2019/3/18
17-
**/
17+
*/
1818
public final class MailUtils {
1919

2020
/**

src/main/java/org/code4everything/boot/message/MessageSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @author pantao
55
* @since 2019/4/11
6-
**/
6+
*/
77
@FunctionalInterface
88
public interface MessageSender {
99

0 commit comments

Comments
 (0)