MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / Quin

Class Quin

src/main/java/field/utility/Quin.java:6–44  ·  view source on GitHub ↗

Created by marc on 3/25/14.

Source from the content-addressed store, hash-verified

4 * Created by marc on 3/25/14.
5 */
6public class Quin<A, B, C, D, E> extends Quad<A, B, C, D> {
7 final public E fifth;
8
9 public Quin(A first, B second, C third, D fourth, E fifth) {
10 super(first, second, third, fourth);
11 this.fifth = fifth;
12 }
13
14 @Override
15 public boolean equals(Object o) {
16 if (this == o) return true;
17 if (!(o instanceof Quin)) return false;
18 if (!super.equals(o)) return false;
19
20 Quin quin = (Quin) o;
21
22 return !(fifth != null ? !fifth.equals(quin.fifth) : quin.fifth != null);
23
24 }
25
26 @Override
27 public int hashCode() {
28 int result = super.hashCode();
29 result = 31 * result + (fifth != null ? fifth.hashCode() : 0);
30 return result;
31 }
32
33 public String toString() {
34 return String.format("Quin{%s,%s,%s,%s,%s}", this.first, this.second, this.third, this.fourth, this.fifth);
35 }
36
37 public Quin<A, B, C, D, E> duplicate() {
38 return new Quin(this.first instanceof Mutable ? ((Mutable) this.first).duplicate() : this.first,
39 this.second instanceof Mutable ? ((Mutable) this.second).duplicate() : this.second,
40 this.third instanceof Mutable ? ((Mutable) this.third).duplicate() : this.third,
41 this.fourth instanceof Mutable ? ((Mutable) this.fourth).duplicate() : this.fourth,
42 this.fifth instanceof Mutable ? ((Mutable) this.fifth).duplicate() : this.fifth);
43 }
44}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected