doum
6 天以前 2b287056e2f59518888d05a1bbc7e5a55fbd84d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.doumee.lib_coremodel.config;
 
import android.content.Context;
 
import androidx.room.RoomDatabase;
 
import com.doumee.lib_coremodel.di.module.ConfigModule;
import com.doumee.lib_coremodel.http.InterceptorConfig;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
 
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
 
 
/**
 * 为框架提供一些配置参数入口
 * @see <a href="https://github.com/bumptech/glide/blob/f7d860412f061e059aa84a42f2563a01ac8c303b/library/src/main/java/com/bumptech/glide/module/AppliesOptions.java">Glide</a>
 * @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
 */
public interface AppliesOptions {
 
    /**
     * 为框架提供一些配置参数入口
     * @param context
     * @param builder
     */
    void applyOptions(Context context, ConfigModule.Builder builder);
 
    /**
     * 为框架中的{@link Retrofit}提供配置参数入口
     */
    interface RetrofitOptions{
        void applyOptions(Retrofit.Builder builder);
    }
    /**
     * 为框架中的{@link OkHttpClient}提供配置参数入口
     */
    interface OkHttpClientOptions{
        void applyOptions(OkHttpClient.Builder builder);
    }
    /**
     * 为框架中的{@link Gson}提供配置参数入口
     */
    interface GsonOptions{
        void applyOptions(GsonBuilder builder);
    }
 
    /**
     * 为框架中的{@link InterceptorConfig}提供配置参数入口
     */
    interface InterceptorConfigOptions{
        void applyOptions(InterceptorConfig.Builder builder);
    }
    /**
     * 为框架中的{@link Gson}提供配置参数入口
     */
    interface RoomDatabaseOptions<T extends RoomDatabase>{
        void applyOptions(RoomDatabase.Builder<T> builder);
    }
 
}