#278 Code Review of the Triangle Entity

Companies:
Gazprombank
Themes:
JavaOOPCode Review

Perform a code review:

@Entity
@Table(name = "triangle", schema = "application")
class Triangle {

    @Id
    private UUID id;

    @Column
    private int a;

    @Column
    private int b;

    @Column
    private int c;

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

        Triangle triangle = (Triangle) o;
        return a == triangle.a && b == triangle.b && c == triangle.c;
    }

    @Override
    public int hashCode() {
        return com.google.common.base.Objects.hashCode(id, a, b, c);
    }
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in