diff --git a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreFactory.java b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreFactory.java index 59f4573..ca8b3b8 100644 --- a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreFactory.java +++ b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/CacheStoreFactory.java @@ -17,6 +17,8 @@ package net.lamgc.cgj.bot.cache; +import net.lamgc.cgj.bot.cache.convert.StringConverter; + /** * 缓存存储容器构造工厂. * 可支持不同实现缓存存储容器. diff --git a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/Converter.java b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/Converter.java similarity index 96% rename from ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/Converter.java rename to ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/Converter.java index d45fdae..b957300 100644 --- a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/Converter.java +++ b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/Converter.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package net.lamgc.cgj.bot.cache; +package net.lamgc.cgj.bot.cache.convert; /** * 转换器接口 diff --git a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/StringConverter.java b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/StringConverter.java similarity index 95% rename from ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/StringConverter.java rename to ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/StringConverter.java index f982de6..73a6342 100644 --- a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/StringConverter.java +++ b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/StringConverter.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package net.lamgc.cgj.bot.cache; +package net.lamgc.cgj.bot.cache.convert; /** * 某类型到字符串的转换器接口. diff --git a/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/StringToStringConverter.java b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/StringToStringConverter.java new file mode 100644 index 0000000..8b59d79 --- /dev/null +++ b/ContentGrabbingJi-CacheStore-api/src/main/java/net/lamgc/cgj/bot/cache/convert/StringToStringConverter.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2020 LamGC + * + * ContentGrabbingJi is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * ContentGrabbingJi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package net.lamgc.cgj.bot.cache.convert; + +/** + * 字符串原样转换的转换器. + * 不进行任何处理. + * @author LamGC + */ +public class StringToStringConverter implements StringConverter { + @Override + public String to(String source) { + return source; + } + + @Override + public String from(String target) { + return target; + } +}