This commit is contained in:
Looly
2022-09-30 23:00:15 +08:00
parent 00fad42926
commit d6be80f8ea
22 changed files with 173 additions and 130 deletions

View File

@@ -1,5 +1,7 @@
package cn.hutool.json.serialize;
import cn.hutool.core.lang.func.Wrapper;
/**
* {@code JSONString}接口定义了一个{@code toJSONString()}<br>
* 实现此接口的类可以通过实现{@code toJSONString()}方法来改变转JSON字符串的方式。
@@ -8,7 +10,7 @@ package cn.hutool.json.serialize;
*
*/
@FunctionalInterface
public interface JSONString {
public interface JSONString extends Wrapper<Object> {
/**
* 自定义转JSON字符串的方法
@@ -22,6 +24,7 @@ public interface JSONString {
*
* @return 原始对象
*/
@Override
default Object getRaw() {
return this;
}