44 lines
1.1 KiB
Java
Raw Normal View History

package com.wisemapping.service;
import com.wisemapping.dao.LabelManager;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.Label;
import com.wisemapping.model.User;
import org.jetbrains.annotations.NotNull;
2014-01-28 02:28:16 -03:00
import org.jetbrains.annotations.Nullable;
2014-01-26 18:21:01 -03:00
import java.util.List;
public class LabelServiceImpl implements LabelService {
private LabelManager labelManager;
public void setLabelManager(LabelManager labelManager) {
this.labelManager = labelManager;
}
@Override
public void addLabel(@NotNull final Label label, @NotNull final User user) throws WiseMappingException {
label.setCreator(user);
labelManager.addLabel(label);
}
2014-01-26 18:21:01 -03:00
@NotNull
@Override
public List<Label> getAll(@NotNull final User user) {
return labelManager.getAllLabels(user);
}
2014-01-28 02:28:16 -03:00
@Override @Nullable
public Label getLabelById(int id) {
return labelManager.getLabelById(id);
}
2014-01-28 02:21:14 -03:00
@Nullable
@Override
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
return labelManager.getLabelByTitle(title, user);
}
}