Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Convert interfaces to abstract classes.
Browse files Browse the repository at this point in the history
Summary: This will allow us to more easily do non-breaking API changes in the future, as you can introduce new APIs to an abstract class by adding a no-op method implementation.

Reviewers: O2 Material Motion, O6 Material Motion Android platform reviewers, miguelandres

Reviewed By: O6 Material Motion Android platform reviewers, miguelandres

Subscribers: miguelandres

Tags: #material_motion

Differential Revision: http://codereview.cc/D2169
  • Loading branch information
Mark Wei committed Dec 8, 2016
1 parent 50afe0c commit 1475da3
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,32 @@ public MotionObservable(Subscriber<MotionObserver<T>> subscriber) {
/**
* An observer with an additional {@link #state(int)} method.
*/
public interface MotionObserver<T> extends Observer<T> {
public static abstract class MotionObserver<T> implements Observer<T> {

@Override
void next(T value);
public abstract void next(T value);

/**
* A method to handle new incoming state values.
*/
void state(@MotionState int state);
public abstract void state(@MotionState int state);
}

/**
* An operation is able to transform incoming values before choosing whether or not to pass them
* to the observer.
* downstream.
*
* @param <T> The incoming value type.
* @param <U> The observer value type.
* @param <U> The downstream value type.
*/
public interface Operation<T, U> {
public static abstract class Operation<T, U> {

/**
* Transforms the incoming value before passing it to the observer, or blocks the value.
*
* @param value The incoming value.
*/
void next(MotionObserver<U> observer, T value);
public abstract void next(MotionObserver<U> observer, T value);
}

/**
Expand All @@ -103,23 +103,23 @@ public interface Operation<T, U> {
* @param <T> The incoming value type.
* @param <U> The downstream value type.
*/
public interface Transformation<T, U> {
public static abstract class Transformation<T, U> {

/**
* Transforms the given value.
*/
U transform(T value);
public abstract U transform(T value);
}

/**
* A predicate evaluates whether to pass a value downstream.
*/
public interface Predicate<T> {
public static abstract class Predicate<T> {

/**
* Evaluates whether to pass the value.
*/
boolean evaluate(T value);
public abstract boolean evaluate(T value);
}

/**
Expand Down

0 comments on commit 1475da3

Please sign in to comment.