package com.qianwen.core.tool.metadata;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import com.qianwen.core.tool.utils.StringPool;
|
|
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/metadata/DefaultConfigMetadata.class */
|
public class DefaultConfigMetadata implements ConfigMetadata {
|
private static final long serialVersionUID = 0;
|
private String name;
|
private String description;
|
private List<ConfigPropertyMetadata> properties = new ArrayList();
|
|
public void setName(final String name) {
|
this.name = name;
|
}
|
|
public void setDescription(final String description) {
|
this.description = description;
|
}
|
|
public void setProperties(final List<ConfigPropertyMetadata> properties) {
|
this.properties = properties;
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigMetadata
|
public String getName() {
|
return this.name;
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigMetadata
|
public String getDescription() {
|
return this.description;
|
}
|
|
public DefaultConfigMetadata() {
|
}
|
|
public DefaultConfigMetadata(String name, String description) {
|
this.name = name;
|
this.description = description;
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigMetadata
|
public List<ConfigPropertyMetadata> getProperties() {
|
return this.properties;
|
}
|
|
public DefaultConfigMetadata add(ConfigPropertyMetadata metadata) {
|
this.properties.add(metadata);
|
return this;
|
}
|
|
public DefaultConfigMetadata add(String property, String name, String description, DataType type) {
|
return add(Property.of(property, name, description, type));
|
}
|
|
public DefaultConfigMetadata add(String property, String name, DataType type) {
|
return add(property, name, null, type);
|
}
|
|
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/metadata/DefaultConfigMetadata$Property.class */
|
public static class Property implements ConfigPropertyMetadata {
|
private static final long serialVersionUID = 0;
|
private String property;
|
private String name;
|
private String description;
|
private DataType type;
|
|
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/metadata/DefaultConfigMetadata$Property$PropertyBuilder.class */
|
public static class PropertyBuilder {
|
private String property;
|
private String name;
|
private String description;
|
private DataType type;
|
|
PropertyBuilder() {
|
}
|
|
public PropertyBuilder property(final String property) {
|
this.property = property;
|
return this;
|
}
|
|
public PropertyBuilder name(final String name) {
|
this.name = name;
|
return this;
|
}
|
|
public PropertyBuilder description(final String description) {
|
this.description = description;
|
return this;
|
}
|
|
public PropertyBuilder type(final DataType type) {
|
this.type = type;
|
return this;
|
}
|
|
public Property build() {
|
return new Property(this.property, this.name, this.description, this.type);
|
}
|
|
public String toString() {
|
return "DefaultConfigMetadata.Property.PropertyBuilder(property=" + this.property + ", name=" + this.name + ", description=" + this.description + ", type=" + this.type + StringPool.RIGHT_BRACKET;
|
}
|
}
|
|
public void setProperty(final String property) {
|
this.property = property;
|
}
|
|
public void setName(final String name) {
|
this.name = name;
|
}
|
|
public void setDescription(final String description) {
|
this.description = description;
|
}
|
|
public void setType(final DataType type) {
|
this.type = type;
|
}
|
|
public static PropertyBuilder builder() {
|
return new PropertyBuilder();
|
}
|
|
public Property() {
|
}
|
|
private Property(final String property, final String name, final String description, final DataType type) {
|
this.property = property;
|
this.name = name;
|
this.description = description;
|
this.type = type;
|
}
|
|
public static Property of(final String property, final String name, final String description, final DataType type) {
|
return new Property(property, name, description, type);
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigPropertyMetadata
|
public String getProperty() {
|
return this.property;
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigPropertyMetadata
|
public String getName() {
|
return this.name;
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigPropertyMetadata
|
public String getDescription() {
|
return this.description;
|
}
|
|
@Override // org.springblade.core.tool.metadata.ConfigPropertyMetadata
|
public DataType getType() {
|
return this.type;
|
}
|
}
|
}
|