// Path: agera/src/main/java/com/google/android/agera/Common.java
// static final NullOperator NULL_OPERATOR = new NullOperator();
// 
// Path: agera/src/main/java/com/google/android/agera/Functions.java
// @NonNull
// public static <T> Function<T, T> identityFunction() {
//   @SuppressWarnings("unchecked")
//   final Function<T, T> identityFunction = (Function<T, T>) NULL_OPERATOR;
//   return identityFunction;
// }


import static com.google.android.agera.Common.NULL_OPERATOR;
import static com.google.android.agera.CompiledRepository.addBindWith;
import static com.google.android.agera.CompiledRepository.addCheck;
import static com.google.android.agera.CompiledRepository.addEnd;
import static com.google.android.agera.CompiledRepository.addFilterFailure;
import static com.google.android.agera.CompiledRepository.addFilterSuccess;
import static com.google.android.agera.CompiledRepository.addGetFrom;
import static com.google.android.agera.CompiledRepository.addGoLazy;
import static com.google.android.agera.CompiledRepository.addGoTo;
import static com.google.android.agera.CompiledRepository.addMergeIn;
import static com.google.android.agera.CompiledRepository.addSendTo;
import static com.google.android.agera.CompiledRepository.addTransform;
import static com.google.android.agera.CompiledRepository.compiledRepository;
import static com.google.android.agera.Functions.identityFunction;
import static com.google.android.agera.Mergers.objectsUnequal;
import static com.google.android.agera.Preconditions.checkNotNull;
import static com.google.android.agera.Preconditions.checkState;
import android.os.Looper;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.concurrent.Executor;
  }

  @Retention(RetentionPolicy.SOURCE)
  @IntDef({NOTHING, FIRST_EVENT_SOURCE, FREQUENCY_OR_MORE_EVENT_SOURCE, FLOW,
      TERMINATE_THEN_FLOW, TERMINATE_THEN_END, CONFIG})
  private @interface Expect {}

  private static final int NOTHING = 0;
  private static final int FIRST_EVENT_SOURCE = 1;
  private static final int FREQUENCY_OR_MORE_EVENT_SOURCE = 2;
  private static final int FLOW = 3;
  private static final int TERMINATE_THEN_FLOW = 4;
  private static final int TERMINATE_THEN_END = 5;
  private static final int CONFIG = 6;

  private Object initialValue;
  private final ArrayList<Observable> eventSources = new ArrayList<>();
  private int frequency;
  private final ArrayList<Object> directives = new ArrayList<>();
  // 2x fields below: store caseExtractor and casePredicate for check(caseExtractor, casePredicate)
  // for use in terminate(); if null then terminate() is terminating an attempt directive.
  private Function caseExtractor;
  private Predicate casePredicate;
  private boolean goLazyUsed;
  private Merger notifyChecker = objectsUnequal();
  @RepositoryConfig
  private int deactivationConfig;
  @RepositoryConfig
  private int concurrentUpdateConfig;
  @NonNull
// Path: agera/src/main/java/com/google/android/agera/Common.java
// static final NullOperator NULL_OPERATOR = new NullOperator();
// 
// Path: agera/src/main/java/com/google/android/agera/Functions.java
// @NonNull
// public static <T> Function<T, T> identityFunction() {
//   @SuppressWarnings("unchecked")
//   final Function<T, T> identityFunction = (Function<T, T>) NULL_OPERATOR;
//   return identityFunction;
// }


// Path: agera/src/main/java/com/google/android/agera/RepositoryCompiler.java
import static com.google.android.agera.Common.NULL_OPERATOR;
import static com.google.android.agera.CompiledRepository.addBindWith;
import static com.google.android.agera.CompiledRepository.addCheck;
import static com.google.android.agera.CompiledRepository.addEnd;
import static com.google.android.agera.CompiledRepository.addFilterFailure;
import static com.google.android.agera.CompiledRepository.addFilterSuccess;
import static com.google.android.agera.CompiledRepository.addGetFrom;
import static com.google.android.agera.CompiledRepository.addGoLazy;
import static com.google.android.agera.CompiledRepository.addGoTo;
import static com.google.android.agera.CompiledRepository.addMergeIn;
import static com.google.android.agera.CompiledRepository.addSendTo;
import static com.google.android.agera.CompiledRepository.addTransform;
import static com.google.android.agera.CompiledRepository.compiledRepository;
import static com.google.android.agera.Functions.identityFunction;
import static com.google.android.agera.Mergers.objectsUnequal;
import static com.google.android.agera.Preconditions.checkNotNull;
import static com.google.android.agera.Preconditions.checkState;
import android.os.Looper;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.concurrent.Executor;

  }

  @Retention(RetentionPolicy.SOURCE)
  @IntDef({NOTHING, FIRST_EVENT_SOURCE, FREQUENCY_OR_MORE_EVENT_SOURCE, FLOW,
      TERMINATE_THEN_FLOW, TERMINATE_THEN_END, CONFIG})
  private @interface Expect {}

  private static final int NOTHING = 0;
  private static final int FIRST_EVENT_SOURCE = 1;
  private static final int FREQUENCY_OR_MORE_EVENT_SOURCE = 2;
  private static final int FLOW = 3;
  private static final int TERMINATE_THEN_FLOW = 4;
  private static final int TERMINATE_THEN_END = 5;
  private static final int CONFIG = 6;

  private Object initialValue;
  private final ArrayList<Observable> eventSources = new ArrayList<>();
  private int frequency;
  private final ArrayList<Object> directives = new ArrayList<>();
  // 2x fields below: store caseExtractor and casePredicate for check(caseExtractor, casePredicate)
  // for use in terminate(); if null then terminate() is terminating an attempt directive.
  private Function caseExtractor;
  private Predicate casePredicate;
  private boolean goLazyUsed;
  private Merger notifyChecker = objectsUnequal();
  @RepositoryConfig
  private int deactivationConfig;
  @RepositoryConfig
  private int concurrentUpdateConfig;
  @NonNull
  private Receiver discardedValueDisposer = NULL_OPERATOR;