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

90 lines
2.4 KiB
Java
Raw Normal View History

2024-02-04 10:42:16 -08:00
/*
* Copyright [2022] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
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;
2024-02-17 11:18:43 -08:00
import com.wisemapping.model.MindmapLabel;
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
2024-02-17 11:18:43 -08:00
private final MindmapLabel label;
public RestLabel() {
2024-02-17 11:18:43 -08:00
this(new MindmapLabel());
}
2024-02-17 11:18:43 -08:00
public RestLabel(@NotNull final MindmapLabel label) {
this.label = label;
}
2024-02-17 11:18:43 -08:00
public void setParent(final MindmapLabel parent) {
2014-01-26 18:21:01 -03:00
this.label.setParent(parent);
}
@Nullable
2024-02-17 11:18:43 -08:00
public MindmapLabel getParent() {
2014-01-26 18:21:01 -03:00
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
2024-02-17 11:18:43 -08:00
public MindmapLabel getDelegated() {
return label;
}
}