
io.inugami.configuration.models.plugins.components.config.ComponentFieldsModel Maven / Gradle / Ivy
/* --------------------------------------------------------------------
* Inugami
* --------------------------------------------------------------------
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package io.inugami.configuration.models.plugins.components.config;
import io.inugami.api.models.data.basic.JsonObject;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
/**
* ComponentFieldsModel
*
* @author patrickguillerm
* @since 31 août 2018
*/
@XStreamAlias("field")
public class ComponentFieldsModel implements JsonObject {
// =========================================================================
// ATTRIBUTES
// =========================================================================
private static final long serialVersionUID = -2436093273296848422L;
@XStreamAsAttribute
private String name;
@XStreamAsAttribute
private String type;
@XStreamAsAttribute
private String defaultValue;
@XStreamAsAttribute
private String description;
// =========================================================================
// OVERRIDES
// =========================================================================
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
boolean result = this == obj;
if (!result && obj != null && obj instanceof ComponentFieldsModel) {
final ComponentFieldsModel other = (ComponentFieldsModel) obj;
result = name == null ? other.getName() == null : name.equals(other.getName());
}
return result;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder(this.getClass().getSimpleName());
builder.append(convertToJson());
return builder.toString();
}
// =========================================================================
// GETTERS & SETTERS
// =========================================================================
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy