GenericRequestBuilder(Context context, ModelType model, LoadProvider<ModelType, DataType, ResourceType, TranscodeType> loadProvider, Class<TranscodeType> transcodeClass, Glide glide) { this.transcodeClass = transcodeClass; this.glide = glide; this.loadProvider = loadProvider != null ? new ChildLoadProvider<ModelType, DataType, ResourceType, TranscodeType>(loadProvider) : null; preSkipEncoder = loadProvider != null ? loadProvider.getEncoder() : null; if (context == null) { throw new NullPointerException("Context can't be null"); } if (model != null && loadProvider == null) { throw new NullPointerException("LoadProvider must not be null"); } this.context = context; this.model = model; }