Tabnine Logo
Pair.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair
constructor

Best Java code snippets using com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair.<init> (Showing top 12 results out of 315)

origin: Azure/azure-iot-sdk-java

  @Override
  public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext)
  {
    actualStatusUpdates.add(new Pair<>(status, throwable));
  }
}, new Object());
origin: Azure/azure-iot-sdk-java

  @Override
  public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext)
  {
    actualStatusUpdates.add(new Pair<>(status, throwable));
  }
};
origin: Azure/azure-iot-sdk-java

  @Override
  public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext)
  {
    actualStatusUpdates.add(new com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair<>(status, throwable));
  }
};
origin: Azure/azure-iot-sdk-java

  @Override
  public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext)
  {
    statusUpdates.add(new Pair<>(status, throwable));
  }
}, new Object());
origin: Azure/azure-iot-sdk-java

  @Override
  public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext)
  {
    connectionStatusUpdates.add(new Pair<>(status, throwable));
  }
}, null);
origin: Azure/azure-iot-sdk-java

public void setDesiredPropertyCallback(Property desiredProp, PropertyCallBack<String, Object> desiredPropCallBack, Object desiredPropCallBackContext)
{
  if (desiredProp  == null)
  {
    /*
    **Codes_SRS_DEVICE_25_007: [**If the parameter desiredProp is null then this method shall throw IllegalArgumentException**]**
     */
    throw new IllegalArgumentException("desired property cannot be null");
  }
  /*
  **Codes_SRS_DEVICE_25_006: [**The function shall add the property and its callback and context pair to the user map of desired properties.**]**
  **Codes_SRS_DEVICE_25_008: [**This method shall add the parameters to the map even if callback and object pair are null**]**
   */
  this.desiredProp.put(desiredProp, new Pair<>(desiredPropCallBack, desiredPropCallBackContext));
}
origin: Azure/azure-iot-sdk-java

public void setMessageCallback(String inputName, MessageCallback callback, Object context)
{
  if (this.inputChannelMessageCallbacks.containsKey(inputName) && callback == null)
  {
    // Codes_SRS_DEVICECLIENTCONFIG_34_058: [If the provided inputName is already saved in the message callbacks map, and the provided callback is null, this function
    // shall remove the inputName from the message callbacks map.]
    this.inputChannelMessageCallbacks.remove(inputName);
  }
  else
  {
    // Codes_SRS_DEVICECLIENTCONFIG_34_044: [The function shall map the provided inputName to the callback and context in the saved inputChannelMessageCallbacks map.]
    this.inputChannelMessageCallbacks.put(inputName, new Pair<>(callback, context));
  }
}
origin: Azure/azure-iot-sdk-java

public Property(String key, Object value)
{
  if (key == null || key.isEmpty())
  {
    /*
    **Codes_SRS_Property_25_002: [**If the key is null or empty, the constructor shall throw an IllegalArgumentException.**]
     */
    throw new IllegalArgumentException("Key cannot be null or empty");
  }
  if (key.contains(" ") || key.contains("$") || key.contains("."))
  {
    /*
    **Codes_SRS_Property_25_006: [**If the key contains illegal unicode control characters i.e ' ', '.', '$', the constructor shall throw an IllegalArgumentException.**]**
     */
    throw new IllegalArgumentException("Key cannot contain illegal unicode control characters '.', '$', ' '");
  }
  /*
  **Codes_SRS_Property_25_001: [**The constructor shall save the key and value representing this property.**]**
   */
  this.property = new Pair<>(key, value);
}
origin: Azure/azure-iot-sdk-java

@Test
public void testSubscribeToDesiredPropertiesWithVersion() throws IOException, InterruptedException, IotHubException
{
  // arrange
  deviceUnderTest.sCDeviceForTwin.clearTwin();
  deviceUnderTest.dCDeviceForTwin.getDesiredProp().clear();
  Map<Property, Pair<TwinPropertyCallBack, Object>> desiredPropertiesCB = new HashMap<>();
  for (int i = 0; i < MAX_PROPERTIES_TO_TEST; i++)
  {
    PropertyState propertyState = new PropertyState();
    propertyState.callBackTriggered = false;
    propertyState.propertyNewVersion = -1;
    propertyState.property = new Property(PROPERTY_KEY + i, PROPERTY_VALUE);
    deviceUnderTest.dCDeviceForTwin.propertyStateList[i] = propertyState;
    desiredPropertiesCB.put(propertyState.property, new com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair<TwinPropertyCallBack, Object>(deviceUnderTest.dCOnProperty, propertyState));
  }
  // act
  internalClient.subscribeToTwinDesiredProperties(desiredPropertiesCB);
  Thread.sleep(DELAY_BETWEEN_OPERATIONS);
  Set<com.microsoft.azure.sdk.iot.service.devicetwin.Pair> desiredProperties = new HashSet<>();
  for (int i = 0; i < MAX_PROPERTIES_TO_TEST; i++)
  {
    desiredProperties.add(new com.microsoft.azure.sdk.iot.service.devicetwin.Pair(PROPERTY_KEY + i, PROPERTY_VALUE_UPDATE + UUID.randomUUID()));
  }
  deviceUnderTest.sCDeviceForTwin.setDesiredProperties(desiredProperties);
  sCDeviceTwin.updateTwin(deviceUnderTest.sCDeviceForTwin);
  // assert
  waitAndVerifyTwinStatusBecomesSuccess();
  waitAndVerifyDesiredPropertyCallback(PROPERTY_VALUE_UPDATE, true);
}
origin: Azure/azure-iot-sdk-java

propertyState.property = new Property(PROPERTY_KEY + i, PROPERTY_VALUE);
deviceUnderTest.dCDeviceForTwin.propertyStateList[i] = propertyState;
desiredPropertiesCB.put(propertyState.property, new com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair<TwinPropertyCallBack, Object>(deviceUnderTest.dCOnProperty, propertyState));
origin: Azure/azure-iot-sdk-java

put(new Property("HomeTemp(F)", null), new Pair<TwinPropertyCallBack, Object>(new onHomeTempChange(), null));
put(new Property("LivingRoomLights", null), new Pair<TwinPropertyCallBack, Object>(new onProperty(), null));
put(new Property("BedroomRoomLights", null), new Pair<TwinPropertyCallBack, Object>(new onProperty(), null));
put(new Property("HomeSecurityCamera", null), new Pair<TwinPropertyCallBack, Object>(new onCameraActivity(), null));
origin: Azure/azure-iot-sdk-java

put(new Property("HomeTemp(F)", null), new Pair<TwinPropertyCallBack, Object>(new onHomeTempChange(), null));
put(new Property("LivingRoomLights", null), new Pair<TwinPropertyCallBack, Object>(new onProperty(), null));
put(new Property("BedroomRoomLights", null), new Pair<TwinPropertyCallBack, Object>(new onProperty(), null));
put(new Property("HomeSecurityCamera", null), new Pair<TwinPropertyCallBack, Object>(new onCameraActivity(), null));
com.microsoft.azure.sdk.iot.device.DeviceTwinPair<init>

Popular methods of Pair

    Popular in Java

    • Running tasks concurrently on multiple threads
    • getSystemService (Context)
    • getExternalFilesDir (Context)
    • setContentView (Activity)
    • FileNotFoundException (java.io)
      Thrown when a file specified by a program cannot be found.
    • ByteBuffer (java.nio)
      A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
    • Format (java.text)
      The base class for all formats. This is an abstract base class which specifies the protocol for clas
    • ConcurrentHashMap (java.util.concurrent)
      A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
    • ExecutorService (java.util.concurrent)
      An Executor that provides methods to manage termination and methods that can produce a Future for tr
    • ReentrantLock (java.util.concurrent.locks)
      A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
    • Top plugins for Android Studio
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now