Couple and Triple minor cleanup.
This commit is contained in:
parent
b847737de8
commit
51eee0e247
@ -18,10 +18,10 @@ public class Couple<A, B> implements Entry<A, B>, Cloneable, Serializable
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
private final A first;
|
private final A first;
|
||||||
public A getFirst() { return this.first; };
|
public A getFirst() { return this.first; }
|
||||||
|
|
||||||
private final B second;
|
private final B second;
|
||||||
public B getSecond() { return this.second; };
|
public B getSecond() { return this.second; }
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// FIELDS: WITH
|
// FIELDS: WITH
|
||||||
@ -63,7 +63,7 @@ public class Couple<A, B> implements Entry<A, B>, Cloneable, Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public B setValue(B arg0)
|
public B setValue(B value)
|
||||||
{
|
{
|
||||||
throw new IllegalStateException("This entry is a couple which is immutable.");
|
throw new IllegalStateException("This entry is a couple which is immutable.");
|
||||||
}
|
}
|
||||||
@ -82,12 +82,14 @@ public class Couple<A, B> implements Entry<A, B>, Cloneable, Serializable
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object derpObject)
|
public boolean equals(Object object)
|
||||||
{
|
{
|
||||||
if (derpObject == null) return false;
|
if (!(object instanceof Couple<?, ?>)) return false;
|
||||||
if (!(derpObject instanceof Couple<?, ?>)) return false;
|
Couple<?, ?> that = (Couple<?, ?>)object;
|
||||||
Couple<?, ?> derp = (Couple<?, ?>)derpObject;
|
return MUtil.equals(
|
||||||
return MUtil.equals(this.getFirst(), derp.getFirst()) && MUtil.equals(this.getSecond(), derp.getSecond());
|
this.getFirst(), that.getFirst(),
|
||||||
|
this.getSecond(), that.getSecond()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -63,12 +63,15 @@ public class Triple<A, B, C> implements Cloneable, Serializable
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object derpObject)
|
public boolean equals(Object object)
|
||||||
{
|
{
|
||||||
if (derpObject == null) return false;
|
if (!(object instanceof Triple<?, ?, ?>)) return false;
|
||||||
if (!(derpObject instanceof Triple<?, ?, ?>)) return false;
|
Triple<?, ?, ?> that = (Triple<?, ?, ?>)object;
|
||||||
Triple<?, ?, ?> derp = (Triple<?, ?, ?>)derpObject;
|
return MUtil.equals(
|
||||||
return MUtil.equals(this.getFirst(), derp.getFirst()) && MUtil.equals(this.getSecond(), derp.getSecond()) && MUtil.equals(this.getThird(), derp.getThird());
|
this.getFirst(), that.getFirst(),
|
||||||
|
this.getSecond(), that.getSecond(),
|
||||||
|
this.getThird(), that.getThird()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
Loading…
Reference in New Issue
Block a user