package com.hosaka.rxanimation.animator;

import android.animation.Animator;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;

/**
 * Created by shunhosaka on 15/10/09.
 */
public class AnimatorEvent {

    public enum Kind {
        START, END, CANCEL, REPEAT
    }

    @CheckResult @NonNull
    public static AnimatorEvent create(@NonNull Animator animation, @NonNull Kind kind) {
        return new AnimatorEvent(animation, kind);
    }

    private final Kind kind;
    private Animator animation;

    public AnimatorEvent(Animator animation, Kind kind) {
        this.animation = animation;
        this.kind = kind;
    }

    @NonNull
    public Animator animation() {
        return animation;
    }

    @NonNull
    public Kind kind() {
        return kind;
    }

    @Override public boolean equals(Object object) {
        if (object == this) return true;
        if (!(object instanceof AnimatorEvent)) return false;
        AnimatorEvent other = (AnimatorEvent) object;
        return other.animation() == animation()
                && other.kind() == kind();
    }

    @Override public int hashCode() {
        int result = 17;
        result = result * 37 + animation().hashCode();
        result = result * 37 + kind().hashCode();
        return result;
    }

    @Override public String toString() {
        return "AnimationEvent{animation="
                + animation()
                + ", kind="
                + kind()
                + "}";
    }


}

@@ -1380,19 +1380,18 @@
  %22Animat
-ion
+or
 Event%7Ban
@@ -1513,11 +1513,10 @@
 %0A    %7D%0A%0A
-%0A
 %7D%0A

fix typo