aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/interpreter/errors/WrongNumberOfArguments.java
blob: 90078e8b81c9929b08c9d8a530b772b216d93bd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package org.zwobble.couscous.interpreter.errors;

public final class WrongNumberOfArguments extends InterpreterException {
    private static final long serialVersionUID = 1L;
    private final int expected;
    private final int actual;
    
    public WrongNumberOfArguments(final int expected, final int actual) {
        this.expected = expected;
        this.actual = actual;
    }
    
    public int getExpected() {
        return this.expected;
    }
    
    public int getActual() {
        return this.actual;
    }
    
    @java.lang.Override
    public java.lang.String toString() {
        return "WrongNumberOfArguments(expected=" + this.getExpected() + ", actual=" + this.getActual() + ")";
    }
    
    @java.lang.Override
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof WrongNumberOfArguments)) return false;
        final WrongNumberOfArguments other = (WrongNumberOfArguments)o;
        if (!other.canEqual((java.lang.Object)this)) return false;
        if (this.getExpected() != other.getExpected()) return false;
        if (this.getActual() != other.getActual()) return false;
        return true;
    }
    
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof WrongNumberOfArguments;
    }
    
    @java.lang.Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getExpected();
        result = result * PRIME + this.getActual();
        return result;
    }
}