Codota Logo
Pair.<init>
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
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
    • addToBackStack (FragmentTransaction)
    • orElseThrow (Optional)
    • getSupportFragmentManager (FragmentActivity)
      Return the FragmentManager for interacting with fragments associated with this activity.
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • ArrayList (java.util)
      Resizable-array implementation of the List interface. Implements all optional list operations, and p
    • Comparator (java.util)
      A Comparator is used to compare two objects to determine their ordering with respect to each other.
    • ThreadPoolExecutor (java.util.concurrent)
      An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
    • Annotation (javassist.bytecode.annotation)
      The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
    • Join (org.hibernate.mapping)
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now