mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -59,7 +59,7 @@ public abstract class ProxyFactory implements Serializable {
|
||||
* @return 代理对象
|
||||
*/
|
||||
public static <T> T createProxy(final T target, final Aspect aspect) {
|
||||
return create().proxy(target, aspect);
|
||||
return of().proxy(target, aspect);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ public abstract class ProxyFactory implements Serializable {
|
||||
*
|
||||
* @return 代理工厂
|
||||
*/
|
||||
public static ProxyFactory create() {
|
||||
public static ProxyFactory of() {
|
||||
return ServiceLoaderUtil.loadFirstAvailable(ProxyFactory.class);
|
||||
}
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ public class CompressUtil {
|
||||
if (ArchiveStreamFactory.SEVEN_Z.equalsIgnoreCase(archiverName)) {
|
||||
return new SevenZArchiver(file);
|
||||
}
|
||||
return StreamArchiver.create(charset, archiverName, file);
|
||||
return StreamArchiver.of(charset, archiverName, file);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ public class CompressUtil {
|
||||
if (ArchiveStreamFactory.SEVEN_Z.equalsIgnoreCase(archiverName)) {
|
||||
return new SevenZArchiver(out);
|
||||
}
|
||||
return StreamArchiver.create(charset, archiverName, out);
|
||||
return StreamArchiver.of(charset, archiverName, out);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -41,7 +41,7 @@ public class StreamArchiver implements Archiver {
|
||||
* @param file 归档输出的文件
|
||||
* @return StreamArchiver
|
||||
*/
|
||||
public static StreamArchiver create(final Charset charset, final String archiverName, final File file) {
|
||||
public static StreamArchiver of(final Charset charset, final String archiverName, final File file) {
|
||||
return new StreamArchiver(charset, archiverName, file);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class StreamArchiver implements Archiver {
|
||||
* @param out 归档输出的流
|
||||
* @return StreamArchiver
|
||||
*/
|
||||
public static StreamArchiver create(final Charset charset, final String archiverName, final OutputStream out) {
|
||||
public static StreamArchiver of(final Charset charset, final String archiverName, final OutputStream out) {
|
||||
return new StreamArchiver(charset, archiverName, out);
|
||||
}
|
||||
|
||||
|
@@ -22,7 +22,7 @@ public class ExpressionFactory {
|
||||
* @return 单例的{@link ExpressionEngine}
|
||||
*/
|
||||
public static ExpressionEngine get(){
|
||||
return Singleton.get(ExpressionEngine.class.getName(), ExpressionFactory::create);
|
||||
return Singleton.get(ExpressionEngine.class.getName(), ExpressionFactory::of);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ public class ExpressionFactory {
|
||||
*
|
||||
* @return {@link ExpressionEngine}
|
||||
*/
|
||||
public static ExpressionEngine create() {
|
||||
public static ExpressionEngine of() {
|
||||
final ExpressionEngine engine = doCreate();
|
||||
StaticLog.debug("Use [{}] Engine As Default.", StrUtil.removeSuffix(engine.getClass().getSimpleName(), "Engine"));
|
||||
return engine;
|
||||
|
@@ -141,7 +141,7 @@ public class Ftp extends AbstractFtp {
|
||||
* @since 5.7.22
|
||||
*/
|
||||
public Ftp(final FTPClient client) {
|
||||
super(FtpConfig.create());
|
||||
super(FtpConfig.of());
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,7 @@ import java.nio.charset.Charset;
|
||||
public class FtpConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static FtpConfig create() {
|
||||
public static FtpConfig of() {
|
||||
return new FtpConfig();
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ public class SimpleFtpServer {
|
||||
*
|
||||
* @return SimpleFtpServer
|
||||
*/
|
||||
public static SimpleFtpServer create() {
|
||||
public static SimpleFtpServer of() {
|
||||
return new SimpleFtpServer();
|
||||
}
|
||||
|
||||
|
@@ -91,7 +91,7 @@ public class Mail implements Builder<MimeMessage> {
|
||||
* @param mailAccount 邮件帐号
|
||||
* @return Mail
|
||||
*/
|
||||
public static Mail create(final MailAccount mailAccount) {
|
||||
public static Mail of(final MailAccount mailAccount) {
|
||||
return new Mail(mailAccount);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class Mail implements Builder<MimeMessage> {
|
||||
*
|
||||
* @return Mail
|
||||
*/
|
||||
public static Mail create() {
|
||||
public static Mail of() {
|
||||
return new Mail();
|
||||
}
|
||||
|
||||
|
@@ -388,7 +388,7 @@ public class MailUtil {
|
||||
*/
|
||||
private static String send(final MailAccount mailAccount, final boolean useGlobalSession, final Collection<String> tos, final Collection<String> ccs, final Collection<String> bccs, final String subject, final String content,
|
||||
final Map<String, InputStream> imageMap, final boolean isHtml, final File... files) {
|
||||
final Mail mail = Mail.create(mailAccount).setUseGlobalSession(useGlobalSession);
|
||||
final Mail mail = Mail.of(mailAccount).setUseGlobalSession(useGlobalSession);
|
||||
|
||||
// 可选抄送人
|
||||
if (CollUtil.isNotEmpty(ccs)) {
|
||||
|
@@ -21,7 +21,7 @@ public class PinyinFactory {
|
||||
* @return 单例的PinyinEngine
|
||||
*/
|
||||
public static PinyinEngine get(){
|
||||
return Singleton.get(PinyinEngine.class.getName(), PinyinFactory::create);
|
||||
return Singleton.get(PinyinEngine.class.getName(), PinyinFactory::of);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ public class PinyinFactory {
|
||||
*
|
||||
* @return {@link PinyinEngine}
|
||||
*/
|
||||
public static PinyinEngine create() {
|
||||
public static PinyinEngine of() {
|
||||
final PinyinEngine engine = doCreate();
|
||||
StaticLog.debug("Use [{}] Engine As Default.", StrUtil.removeSuffix(engine.getClass().getSimpleName(), "Engine"));
|
||||
return engine;
|
||||
|
@@ -50,7 +50,7 @@ public class QrConfig {
|
||||
* @return QrConfig
|
||||
* @since 4.1.14
|
||||
*/
|
||||
public static QrConfig create() {
|
||||
public static QrConfig of() {
|
||||
return new QrConfig();
|
||||
}
|
||||
|
||||
|
@@ -111,7 +111,7 @@ public class Sftp extends AbstractFtp {
|
||||
* @since 4.1.14
|
||||
*/
|
||||
public Sftp(final Session session, final Charset charset) {
|
||||
super(FtpConfig.create().setCharset(charset));
|
||||
super(FtpConfig.of().setCharset(charset));
|
||||
init(session, charset);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class Sftp extends AbstractFtp {
|
||||
* @param charset 编码
|
||||
*/
|
||||
public Sftp(final ChannelSftp channel, final Charset charset) {
|
||||
super(FtpConfig.create().setCharset(charset));
|
||||
super(FtpConfig.of().setCharset(charset));
|
||||
init(channel, charset);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class Sftp extends AbstractFtp {
|
||||
* @since 5.8.4
|
||||
*/
|
||||
public Sftp(final Session session, final Charset charset, final long timeOut) {
|
||||
super(FtpConfig.create().setCharset(charset).setConnectionTimeout(timeOut));
|
||||
super(FtpConfig.of().setCharset(charset).setConnectionTimeout(timeOut));
|
||||
init(session, charset);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public class Sftp extends AbstractFtp {
|
||||
* @since 5.8.4
|
||||
*/
|
||||
public Sftp(final ChannelSftp channel, final Charset charset, final long timeOut) {
|
||||
super(FtpConfig.create().setCharset(charset).setConnectionTimeout(timeOut));
|
||||
super(FtpConfig.of().setCharset(charset).setConnectionTimeout(timeOut));
|
||||
init(channel, charset);
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------- Constructor end
|
||||
|
@@ -18,7 +18,7 @@ public class TemplateUtil {
|
||||
* @since 4.1.11
|
||||
*/
|
||||
public static TemplateEngine createEngine() {
|
||||
return TemplateFactory.create();
|
||||
return TemplateFactory.of();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,6 +29,6 @@ public class TemplateUtil {
|
||||
* @return {@link TemplateEngine}
|
||||
*/
|
||||
public static TemplateEngine createEngine(final TemplateConfig config) {
|
||||
return TemplateFactory.create(config);
|
||||
return TemplateFactory.of(config);
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ public class TemplateFactory {
|
||||
* @return 单例的TemplateEngine
|
||||
*/
|
||||
public static TemplateEngine get(){
|
||||
return Singleton.get(TemplateEngine.class.getName(), TemplateFactory::create);
|
||||
return Singleton.get(TemplateEngine.class.getName(), TemplateFactory::of);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,8 +33,8 @@ public class TemplateFactory {
|
||||
* @return {@link TemplateEngine}
|
||||
* @since 5.3.3
|
||||
*/
|
||||
public static TemplateEngine create() {
|
||||
return create(new TemplateConfig());
|
||||
public static TemplateEngine of() {
|
||||
return of(new TemplateConfig());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ public class TemplateFactory {
|
||||
* @param config 模板配置,包括编码、模板文件path等信息
|
||||
* @return {@link TemplateEngine}
|
||||
*/
|
||||
public static TemplateEngine create(final TemplateConfig config) {
|
||||
public static TemplateEngine of(final TemplateConfig config) {
|
||||
final TemplateEngine engine = doCreate(config);
|
||||
StaticLog.debug("Use [{}] Engine As Default.", StrUtil.removeSuffix(engine.getClass().getSimpleName(), "Engine"));
|
||||
return engine;
|
||||
|
@@ -84,7 +84,7 @@ public class WitEngine implements TemplateEngine {
|
||||
Dict dict = null;
|
||||
|
||||
if (null != config) {
|
||||
dict = Dict.create();
|
||||
dict = Dict.of();
|
||||
// 自定义编码
|
||||
dict.set("DEFAULT_ENCODING", config.getCharset());
|
||||
|
||||
|
@@ -4,7 +4,7 @@ import cn.hutool.extra.tokenizer.engine.TokenizerFactory;
|
||||
|
||||
/**
|
||||
* 分词工具类
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
* @since 4.3.3
|
||||
*/
|
||||
@@ -12,10 +12,10 @@ public class TokenizerUtil {
|
||||
|
||||
/**
|
||||
* 根据用户引入的分词引擎jar,自动创建对应的分词引擎对象
|
||||
*
|
||||
*
|
||||
* @return {@link TokenizerEngine}
|
||||
*/
|
||||
public static TokenizerEngine createEngine() {
|
||||
return TokenizerFactory.create();
|
||||
return TokenizerFactory.of();
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ public class TokenizerFactory {
|
||||
* @since 5.3.3
|
||||
*/
|
||||
public static TokenizerEngine get(){
|
||||
return Singleton.get(TokenizerEngine.class.getName(), TokenizerFactory::create);
|
||||
return Singleton.get(TokenizerEngine.class.getName(), TokenizerFactory::of);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ public class TokenizerFactory {
|
||||
*
|
||||
* @return {@link TokenizerEngine}
|
||||
*/
|
||||
public static TokenizerEngine create() {
|
||||
public static TokenizerEngine of() {
|
||||
final TokenizerEngine engine = doCreate();
|
||||
StaticLog.debug("Use [{}] Tokenizer Engine As Default.", StrUtil.removeSuffix(engine.getClass().getSimpleName(), "Engine"));
|
||||
return engine;
|
||||
|
Reference in New Issue
Block a user