2014-01-25 23:21:17 -03:00
|
|
|
package com.wisemapping.model;
|
|
|
|
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
|
|
public class Label {
|
|
|
|
|
|
|
|
//~ Instance fields ......................................................................................
|
|
|
|
private int id;
|
|
|
|
@NotNull private String title;
|
|
|
|
@NotNull private User creator;
|
|
|
|
@Nullable private Label parent;
|
2014-01-28 00:13:29 -03:00
|
|
|
@NotNull private String color;
|
2014-01-25 23:21:17 -03:00
|
|
|
|
|
|
|
public void setParent(@Nullable Label parent) {
|
|
|
|
this.parent = parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
public Label getParent() {
|
|
|
|
return parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreator(@NotNull User creator) {
|
|
|
|
this.creator = creator;
|
|
|
|
}
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
public User getCreator() {
|
|
|
|
return creator;
|
|
|
|
}
|
|
|
|
|
2014-02-10 00:58:19 -03:00
|
|
|
@Nullable
|
2014-01-25 23:21:17 -03:00
|
|
|
public String getTitle() {
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTitle(@NotNull String title) {
|
|
|
|
this.title = title;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setId(int id) {
|
|
|
|
this.id = id;
|
|
|
|
}
|
2014-01-28 00:13:29 -03:00
|
|
|
|
|
|
|
@NotNull
|
|
|
|
public String getColor() {
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setColor(@NotNull String color) {
|
|
|
|
this.color = color;
|
|
|
|
}
|
2014-02-05 02:11:23 -03:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (this == o) return true;
|
|
|
|
if (!(o instanceof Label)) return false;
|
|
|
|
|
|
|
|
Label label = (Label) o;
|
|
|
|
|
|
|
|
return id == label.id && creator.getId() == label.creator.getId()
|
|
|
|
&& !(parent != null ? !parent.equals(label.parent) : label.parent != null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
|
|
|
int result = id;
|
|
|
|
result = 31 * result + title.hashCode();
|
|
|
|
result = 31 * result + creator.hashCode();
|
|
|
|
result = 31 * result + (parent != null ? parent.hashCode() : 0);
|
|
|
|
return result;
|
|
|
|
}
|
2014-01-25 23:21:17 -03:00
|
|
|
}
|