Hi,
Can someone help with validation, I am failing on:
Create a constructor with two parameters: a view and an array of providers. Throw an IllegalArgumentException if invalid data is passed.
Use a variable-length argument for the Providers
I am checking the length of array but it is not accepted:
public Model(View v, Provider[] ps) {
if (v == null || ps == null || ps.length == 0) {
throw new IllegalArgumentException();
}
this.view = v;
this.providers = ps;
}
package com.codegym.task.task28.task2810;
import com.codegym.task.task28.task2810.model.LinkedinStrategy;
import com.codegym.task.task28.task2810.model.Provider;
public class Aggregator {
public static void main(String[] args) {
Provider provider = new Provider(new LinkedinStrategy());
Controller controller = new Controller(provider);
controller.scan();
}
}