Files
wisemapping-open-source/wise-api/src/main/java/com/wisemapping/rest/model/RestLabel.java

72 lines
1.6 KiB
Java
Raw Normal View History

package com.wisemapping.rest.model;
2020-11-06 21:35:54 -08:00
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.wisemapping.model.Label;
import org.jetbrains.annotations.NotNull;
2014-01-26 18:21:01 -03:00
import org.jetbrains.annotations.Nullable;
2020-11-06 21:35:54 -08:00
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
@JsonAutoDetect(
fieldVisibility = NONE,
setterVisibility = PUBLIC_ONLY,
isGetterVisibility = NONE,
getterVisibility = PUBLIC_ONLY
)
2014-01-26 18:21:01 -03:00
@JsonIgnoreProperties(ignoreUnknown = true)
public class RestLabel {
@JsonIgnore
private final Label label;
public RestLabel() {
this(new Label());
}
public RestLabel(@NotNull final Label label) {
this.label = label;
}
2024-01-23 22:20:10 -08:00
public void setParent(final Label parent) {
2014-01-26 18:21:01 -03:00
this.label.setParent(parent);
}
@Nullable
public Label getParent() {
return this.label.getParent();
}
2014-02-10 00:58:19 -03:00
@Nullable
public String getTitle() {
return this.label.getTitle();
}
public int getId() {
return label.getId();
}
public void setId(int id) {
label.setId(id);
}
public void setTitle(String title) {
label.setTitle(title);
}
2024-01-23 22:31:46 -08:00
public void setColor(final String color) {
2014-01-28 00:13:29 -03:00
label.setColor(color);
}
2014-02-10 00:58:19 -03:00
@Nullable public String getColor() {
2014-01-28 00:13:29 -03:00
return label.getColor();
}
@JsonIgnore
public Label getDelegated() {
return label;
}
}