private void checkGeneralPreconditions(String host, int port, int timeoutInMs, ErrorHandler errorHandler) { Preconditions.checkNotNullOrEmpty(host, "host is null or empty"); Preconditions.checkGreaterThanZero(port, "port is not a positive number"); Preconditions.checkGreaterThanZero(timeoutInMs, "timeoutInMs is not a positive number"); Preconditions.checkNotNull(errorHandler, "errorHandler is null"); }
public static Connectivity create(@NonNull Context context) { Preconditions.checkNotNull(context, "context == null"); return create(context, getConnectivityManager(context)); }
public static Builder state(NetworkInfo.DetailedState detailedState) { return builder().detailedState(detailedState); }
public static Builder subTypeName(String subTypeName) { return builder().subTypeName(subTypeName); }
/** * Creates a new instance of the ReactiveNetwork class * * @return ReactiveNetwork object */ public static ReactiveNetwork create() { return new ReactiveNetwork(); }
private static void checkStrategyIsNotNull(InternetObservingStrategy strategy) { Preconditions.checkNotNull(strategy, "strategy == null"); } }
private Connectivity() { this(builder()); }
public Connectivity build() { return new Connectivity(this); } }
private static Builder builder() { return new Connectivity.Builder(); }
private void checkGeneralPreconditions(final String host, final int port, final int timeoutInMs, final int httpResponse, final ErrorHandler errorHandler) { Preconditions.checkNotNullOrEmpty(host, "host is null or empty"); Preconditions.checkGreaterThanZero(port, "port is not a positive number"); Preconditions.checkGreaterThanZero(timeoutInMs, "timeoutInMs is not a positive number"); Preconditions.checkNotNull(errorHandler, "errorHandler is null"); Preconditions.checkNotNull(httpResponse, "httpResponse is null"); Preconditions.checkGreaterThanZero(httpResponse, "httpResponse is not a positive number"); }