protected Observable < DocumentFragment < Mutation > > doSingleMutate ( MutationSpec spec , long timeout , TimeUnit timeUnit ) { Observable < DocumentFragment < Mutation >> mutation ; switch ( spec . type ( ) ) { case DICT_UPSERT : mutation = doSingleMutate ( spec , DICT_UPSERT_FACTORY , DICT_UPSERT_EVALUATOR , timeout , timeUnit ) ; break ; case DICT_ADD : mutation = doSingleMutate ( spec , DICT_ADD_FACTORY , DICT_ADD_EVALUATOR , timeout , timeUnit ) ; break ; case REPLACE : mutation = doSingleMutate ( spec , REPLACE_FACTORY , REPLACE_EVALUATOR , timeout , timeUnit ) ; break ; case ARRAY_PUSH_FIRST : case ARRAY_PUSH_LAST : mutation = doSingleMutate ( spec , ARRAY_EXTEND_FACTORY , ARRAY_EXTEND_EVALUATOR , timeout , timeUnit ) ; break ; case ARRAY_INSERT : mutation = doSingleMutate ( spec , ARRAY_INSERT_FACTORY , ARRAY_INSERT_EVALUATOR , timeout , timeUnit ) ; break ; case ARRAY_ADD_UNIQUE : mutation = doSingleMutate ( spec , ARRAY_ADDUNIQUE_FACTORY , ARRAY_ADDUNIQUE_EVALUATOR , timeout , timeUnit ) ; break ; case COUNTER : mutation = counterIn ( spec , timeout , timeUnit ) ; break ; case DELETE : mutation = removeIn ( spec , timeout , timeUnit ) ; break ; default : mutation = Observable . error ( new UnsupportedOperationException ( ) ) ; break ; } return subdocObserveMutation ( mutation , timeout , timeUnit ) ; }
Single operation implementations