Java Code Examples for io.particle.android.sdk.utils.Preconditions#checkNotNull()

The following examples show how to use io.particle.android.sdk.utils.Preconditions#checkNotNull() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NextActivitySelector.java    From particle-android with Apache License 2.0 5 votes vote down vote up
private NextActivitySelector(ParticleCloud cloud,
                             SensitiveDataStorage credStorage,
                             SetupCompleteIntentBuilder setupCompleteIntentBuilder) {
    Preconditions.checkNotNull(setupCompleteIntentBuilder, "SetupCompleteIntentBuilder instance is null");

    this.cloud = cloud;
    this.credStorage = credStorage;
    this.setupCompleteIntentBuilder = setupCompleteIntentBuilder;
}
 
Example 2
Source File: EnsureSoftApNotVisible.java    From particle-android with Apache License 2.0 5 votes vote down vote up
EnsureSoftApNotVisible(StepConfig stepConfig, SSID softApSSID, WifiFacade wifiFacade) {
    super(stepConfig);
    Preconditions.checkNotNull(softApSSID, "softApSSID cannot be null.");
    this.wifiFacade = wifiFacade;
    this.softApName = softApSSID;
    this.matchesSoftApSSID = softApName::equals;
}
 
Example 3
Source File: ParticleDeviceSetupLibrary.java    From particle-android with Apache License 2.0 5 votes vote down vote up
/**
 * Start the device setup process.
 *
 * @deprecated Use {@link ParticleDeviceSetupLibrary#startDeviceSetup(Context, Class)}
 * or {@link ParticleDeviceSetupLibrary#startDeviceSetup(Context, SetupCompleteIntentBuilder)} instead.
 */
@Deprecated
public static void startDeviceSetup(Context ctx) {
    Preconditions.checkNotNull(instance.setupCompleteIntentBuilder,
            "SetupCompleteIntentBuilder instance is null");

    ctx.startActivity(new Intent(ctx, GetReadyActivity.class));
}
 
Example 4
Source File: NextActivitySelector.java    From spark-setup-android with Apache License 2.0 5 votes vote down vote up
private NextActivitySelector(ParticleCloud cloud,
                             SensitiveDataStorage credStorage,
                             SetupCompleteIntentBuilder setupCompleteIntentBuilder) {
    Preconditions.checkNotNull(setupCompleteIntentBuilder, "SetupCompleteIntentBuilder instance is null");

    this.cloud = cloud;
    this.credStorage = credStorage;
    this.setupCompleteIntentBuilder = setupCompleteIntentBuilder;
}
 
Example 5
Source File: EnsureSoftApNotVisible.java    From spark-setup-android with Apache License 2.0 5 votes vote down vote up
EnsureSoftApNotVisible(StepConfig stepConfig, SSID softApSSID, WifiFacade wifiFacade) {
    super(stepConfig);
    Preconditions.checkNotNull(softApSSID, "softApSSID cannot be null.");
    this.wifiFacade = wifiFacade;
    this.softApName = softApSSID;
    this.matchesSoftApSSID = softApName::equals;
}
 
Example 6
Source File: ParticleDeviceSetupLibrary.java    From spark-setup-android with Apache License 2.0 5 votes vote down vote up
/**
 * Start the device setup process.
 *
 * @deprecated Use {@link ParticleDeviceSetupLibrary#startDeviceSetup(Context, Class)}
 * or {@link ParticleDeviceSetupLibrary#startDeviceSetup(Context, SetupCompleteIntentBuilder)} instead.
 */
@Deprecated
public static void startDeviceSetup(Context ctx) {
    Preconditions.checkNotNull(instance.setupCompleteIntentBuilder,
            "SetupCompleteIntentBuilder instance is null");

    ctx.startActivity(new Intent(ctx, GetReadyActivity.class));
}
 
Example 7
Source File: SetCommand.java    From particle-android with Apache License 2.0 4 votes vote down vote up
public SetCommand(String key, String value) {
    Preconditions.checkNotNull(key, "Key cannot be null");
    Preconditions.checkNotNull(value, "Value cannot be null");
    this.key = key;
    this.value = value;
}
 
Example 8
Source File: WaitForDisconnectionFromDeviceStep.java    From particle-android with Apache License 2.0 4 votes vote down vote up
WaitForDisconnectionFromDeviceStep(StepConfig stepConfig, SSID softApSSID, WifiFacade wifiFacade) {
    super(stepConfig);
    Preconditions.checkNotNull(softApSSID, "softApSSID cannot be null.");
    this.softApName = softApSSID;
    this.wifiFacade = wifiFacade;
}
 
Example 9
Source File: ParticleDeviceSetupLibrary.java    From particle-android with Apache License 2.0 4 votes vote down vote up
public static ParticleDeviceSetupLibrary getInstance() {
    Preconditions.checkNotNull(instance,
            "Library instance is null: did you call ParticleDeviceSetupLibrary.init()?");
    return instance;
}
 
Example 10
Source File: SetCommand.java    From spark-setup-android with Apache License 2.0 4 votes vote down vote up
public SetCommand(String key, String value) {
    Preconditions.checkNotNull(key, "Key cannot be null");
    Preconditions.checkNotNull(value, "Value cannot be null");
    this.key = key;
    this.value = value;
}
 
Example 11
Source File: WaitForDisconnectionFromDeviceStep.java    From spark-setup-android with Apache License 2.0 4 votes vote down vote up
WaitForDisconnectionFromDeviceStep(StepConfig stepConfig, SSID softApSSID, WifiFacade wifiFacade) {
    super(stepConfig);
    Preconditions.checkNotNull(softApSSID, "softApSSID cannot be null.");
    this.softApName = softApSSID;
    this.wifiFacade = wifiFacade;
}
 
Example 12
Source File: ParticleDeviceSetupLibrary.java    From spark-setup-android with Apache License 2.0 4 votes vote down vote up
public static ParticleDeviceSetupLibrary getInstance() {
    Preconditions.checkNotNull(instance,
            "Library instance is null: did you call ParticleDeviceSetupLibrary.init()?");
    return instance;
}