Spring Boot/코드정리

[memo] MemoEntity.java

root_go 2022. 10. 26. 17:45
package dev.rootgo.study_web.entities.study;

import java.util.Objects;

public class MemoEntity {
    private int index;
    private String name;
    private String text;

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        MemoEntity memo = (MemoEntity) o;
        return index == memo.index;
    }

    @Override
    public int hashCode() {
        return Objects.hash(index);
    }
}