// Path: cacheio-repository/src/main/java/com/mobilejazz/cacheio/query/Query.java
// public interface Query {
// 
//   String getId();
// }
// 
// Path: cacheio-core/src/main/java/com/mobilejazz/cacheio/helper/Preconditions.java
// public static <T> T checkArgument(T object, String message) {
//   if (object == null) {
//     throw new IllegalArgumentException(message);
//   }
// 
//   return object;
// }
// 
// Path: cacheio-core/src/main/java/com/mobilejazz/cacheio/helper/Preconditions.java
// public static String checkIsEmpty(String object, String message) {
//   if (TextUtils.isEmpty(object)) {
//     throw new IllegalArgumentException(message);
//   }
// 
//   return object;
// }


import com.mobilejazz.cacheio.query.Query;
import rx.Single;
import rx.functions.Func1;
import java.util.*;
import java.util.concurrent.*;
import static com.mobilejazz.cacheio.helper.Preconditions.checkArgument;
import static com.mobilejazz.cacheio.helper.Preconditions.checkIsEmpty;
        });
  }

  public static final class Builder<M extends HasId<String>, Q extends Query> {

    private RxCache<String, M> cache;
    private RxCache<Q, StringList> queryCache;

    public Builder() {
    }

    public Builder(Builder<M, Q> proto) {
      this.cache = proto.cache;
      this.queryCache = proto.queryCache;
    }

    public Builder<M, Q> setCache(RxCache<String, M> cache) {
      this.cache = cache;
      return this;
    }

    public Builder<M, Q> setQueryCache(RxCache<Q, StringList> queryCache) {
      this.queryCache = queryCache;
      return this;
    }

    public StringKeyedRxRepository<M, Q> build() {
      checkArgument(cache, "cache cannot be null");
      checkArgument(queryCache, "query cache cannot be null");

// Path: cacheio-repository/src/main/java/com/mobilejazz/cacheio/query/Query.java
// public interface Query {
// 
//   String getId();
// }
// 
// Path: cacheio-core/src/main/java/com/mobilejazz/cacheio/helper/Preconditions.java
// public static <T> T checkArgument(T object, String message) {
//   if (object == null) {
//     throw new IllegalArgumentException(message);
//   }
// 
//   return object;
// }
// 
// Path: cacheio-core/src/main/java/com/mobilejazz/cacheio/helper/Preconditions.java
// public static String checkIsEmpty(String object, String message) {
//   if (TextUtils.isEmpty(object)) {
//     throw new IllegalArgumentException(message);
//   }
// 
//   return object;
// }


// Path: cacheio-repository/src/main/java/com/mobilejazz/cacheio/StringKeyedRxRepository.java
import com.mobilejazz.cacheio.query.Query;
import rx.Single;
import rx.functions.Func1;
import java.util.*;
import java.util.concurrent.*;
import static com.mobilejazz.cacheio.helper.Preconditions.checkArgument;
import static com.mobilejazz.cacheio.helper.Preconditions.checkIsEmpty;

        });
  }

  public static final class Builder<M extends HasId<String>, Q extends Query> {

    private RxCache<String, M> cache;
    private RxCache<Q, StringList> queryCache;

    public Builder() {
    }

    public Builder(Builder<M, Q> proto) {
      this.cache = proto.cache;
      this.queryCache = proto.queryCache;
    }

    public Builder<M, Q> setCache(RxCache<String, M> cache) {
      this.cache = cache;
      return this;
    }

    public Builder<M, Q> setQueryCache(RxCache<Q, StringList> queryCache) {
      this.queryCache = queryCache;
      return this;
    }

    public StringKeyedRxRepository<M, Q> build() {
      checkArgument(cache, "cache cannot be null");
      checkArgument(queryCache, "query cache cannot be null");

      return new StringKeyedRxRepository<>(new Builder<>(this));