Use Lombok for equals() and hashCode() methods in KeyframeSet

This commit is contained in:
CrushedPixel
2015-07-16 15:04:04 +02:00
parent 830087de36
commit 7def1d97ef

View File

@@ -1,13 +1,15 @@
package eu.crushedpixel.replaymod.holders;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@NoArgsConstructor
@EqualsAndHashCode
public class KeyframeSet implements GuiEntryListEntry {
private String name;
private Keyframe<AdvancedPosition>[] positionKeyframes;
@@ -75,19 +77,4 @@ public class KeyframeSet implements GuiEntryListEntry {
public String getDisplayString() {
return name;
}
@Override
public boolean equals(Object o2) {
if(o2 == null) return false;
if(!(o2 instanceof KeyframeSet)) return false;
KeyframeSet set2 = (KeyframeSet)o2;
return hashCode() == set2.hashCode();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(getKeyframes())
.toHashCode();
}
}