mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -107,68 +107,164 @@ public class CpuInfo {
|
||||
this.cpuModel = cpuModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU核心数
|
||||
*
|
||||
* @return CPU核心数
|
||||
*/
|
||||
public Integer getCpuNum() {
|
||||
return cpuNum;
|
||||
}
|
||||
|
||||
public void setCpuNum(final Integer cpuNum) {
|
||||
/**
|
||||
* 设置CPU核心数
|
||||
*
|
||||
* @param cpuNum CPU核心数
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setCpuNum(final Integer cpuNum) {
|
||||
this.cpuNum = cpuNum;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU总使用率
|
||||
*
|
||||
* @return CPU总使用率
|
||||
*/
|
||||
public double getToTal() {
|
||||
return toTal;
|
||||
}
|
||||
|
||||
public void setToTal(final double toTal) {
|
||||
/**
|
||||
* 设置CPU总使用率
|
||||
*
|
||||
* @param toTal CPU总使用率
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setToTal(final double toTal) {
|
||||
this.toTal = toTal;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU系统使用率
|
||||
*
|
||||
* @return CPU系统使用率
|
||||
*/
|
||||
public double getSys() {
|
||||
return sys;
|
||||
}
|
||||
|
||||
public void setSys(final double sys) {
|
||||
/**
|
||||
* 设置CPU系统使用率
|
||||
*
|
||||
* @param sys CPU系统使用率
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setSys(final double sys) {
|
||||
this.sys = sys;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU用户使用率
|
||||
*
|
||||
* @return CPU用户使用率
|
||||
*/
|
||||
public double getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(final double user) {
|
||||
/**
|
||||
* 设置CPU用户使用率
|
||||
*
|
||||
* @param user CPU用户使用率
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setUser(final double user) {
|
||||
this.user = user;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU当前等待率
|
||||
*
|
||||
* @return CPU当前等待率
|
||||
*/
|
||||
public double getWait() {
|
||||
return wait;
|
||||
}
|
||||
|
||||
public void setWait(final double wait) {
|
||||
/**
|
||||
* 设置CPU当前等待率
|
||||
*
|
||||
* @param wait CPU当前等待率
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setWait(final double wait) {
|
||||
this.wait = wait;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU当前空闲率
|
||||
*
|
||||
* @return CPU当前空闲率
|
||||
*/
|
||||
public double getFree() {
|
||||
return free;
|
||||
}
|
||||
|
||||
public void setFree(final double free) {
|
||||
/**
|
||||
* 设置CPU当前空闲率
|
||||
*
|
||||
* @param free CPU当前空闲率
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setFree(final double free) {
|
||||
this.free = free;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU型号信息
|
||||
*
|
||||
* @return CPU型号信息
|
||||
*/
|
||||
public String getCpuModel() {
|
||||
return cpuModel;
|
||||
}
|
||||
|
||||
public void setCpuModel(final String cpuModel) {
|
||||
/**
|
||||
* 设置CPU型号信息
|
||||
*
|
||||
* @param cpuModel CPU型号信息
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setCpuModel(final String cpuModel) {
|
||||
this.cpuModel = cpuModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取CPU ticks
|
||||
*
|
||||
* @return CPU ticks
|
||||
*/
|
||||
public CpuTicks getTicks() {
|
||||
return ticks;
|
||||
}
|
||||
|
||||
public void setTicks(final CpuTicks ticks) {
|
||||
/**
|
||||
* 设置CPU ticks
|
||||
*
|
||||
* @param ticks CPU ticks
|
||||
* @return this
|
||||
*/
|
||||
public CpuInfo setTicks(final CpuTicks ticks) {
|
||||
this.ticks = ticks;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,15 +279,15 @@ public class CpuInfo {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CpuInfo{" +
|
||||
"CPU核心数=" + cpuNum +
|
||||
", CPU总的使用率=" + toTal +
|
||||
", CPU系统使用率=" + sys +
|
||||
", CPU用户使用率=" + user +
|
||||
", CPU当前等待率=" + wait +
|
||||
", CPU当前空闲率=" + free +
|
||||
", CPU利用率=" + getUsed() +
|
||||
", CPU型号信息='" + cpuModel + '\'' +
|
||||
'}';
|
||||
"CPU核心数=" + cpuNum +
|
||||
", CPU总的使用率=" + toTal +
|
||||
", CPU系统使用率=" + sys +
|
||||
", CPU用户使用率=" + user +
|
||||
", CPU当前等待率=" + wait +
|
||||
", CPU当前空闲率=" + free +
|
||||
", CPU利用率=" + getUsed() +
|
||||
", CPU型号信息='" + cpuModel + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,10 +21,7 @@ import cn.hutool.v7.core.io.IoUtil;
|
||||
import cn.hutool.v7.extra.template.Template;
|
||||
import cn.hutool.v7.extra.template.TemplateException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -34,6 +31,7 @@ import java.util.Map;
|
||||
* @author Looly
|
||||
*/
|
||||
public class FreemarkerTemplate implements Template, Serializable{
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8157926902932567280L;
|
||||
|
||||
freemarker.template.Template rawTemplate;
|
||||
|
@@ -112,37 +112,73 @@ public class BeanValidationResult {
|
||||
*/
|
||||
private Object value;
|
||||
|
||||
/**
|
||||
* 获取属性字段名称
|
||||
*
|
||||
* @return 属性字段名称
|
||||
*/
|
||||
public String getPropertyName() {
|
||||
return propertyName;
|
||||
}
|
||||
|
||||
public void setPropertyName(final String propertyName) {
|
||||
/**
|
||||
* 设置属性字段名称
|
||||
*
|
||||
* @param propertyName 属性字段名称
|
||||
* @return this
|
||||
*/
|
||||
public ErrorMessage setPropertyName(final String propertyName) {
|
||||
this.propertyName = propertyName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取错误信息
|
||||
*
|
||||
* @return 错误信息
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(final String message) {
|
||||
/**
|
||||
* 设置错误信息
|
||||
*
|
||||
* @param message 错误信息
|
||||
* @return this
|
||||
*/
|
||||
public ErrorMessage setMessage(final String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取错误值
|
||||
*
|
||||
* @return 错误值
|
||||
*/
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(final Object value) {
|
||||
/**
|
||||
* 设置错误值
|
||||
*
|
||||
* @param value 错误值
|
||||
* @return this
|
||||
*/
|
||||
public ErrorMessage setValue(final Object value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ErrorMessage{" +
|
||||
"propertyName='" + propertyName + '\'' +
|
||||
", message='" + message + '\'' +
|
||||
", value=" + value +
|
||||
'}';
|
||||
"propertyName='" + propertyName + '\'' +
|
||||
", message='" + message + '\'' +
|
||||
", value=" + value +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,4 +16,4 @@
|
||||
|
||||
cn.hutool.v7.extra.mq.engine.kafka.KafkaEngine
|
||||
cn.hutool.v7.extra.mq.engine.rabbitmq.RabbitMQEngine
|
||||
cn.hutool.v7.extra.mq.engine.activemq.ActiveMQ5Engine
|
||||
cn.hutool.v7.extra.mq.engine.rocketmq.RocketMQEngine
|
||||
|
Reference in New Issue
Block a user