public Object getValue() { /* **Codes_SRS_Property_25_004: [**The function shall return the value for this property.**]** */ return this.property.getValue(); }
private boolean reportDeviceTwinGenericPropertyCallback(Property property) { if(deviceTwinGenericPropertyChangeCallback != null) { deviceTwinGenericPropertyChangeCallback.PropertyCall(property.getKey(), property.getValue(), deviceTwinGenericPropertyChangeCallbackContext); return true; } if(deviceTwinGenericTwinPropertyChangeCallback != null) { deviceTwinGenericTwinPropertyChangeCallback.TwinPropertyCallBack(property, deviceTwinGenericPropertyChangeCallbackContext); return true; } return false; } }
public void setValue(Object newValue) { /* **Codes_SRS_Property_25_005: [**The function shall overwrite the new value for old.**]** */ this.property.setValue(newValue); }
@Override public void TwinPropertyCallBack(Property property, Object context) { System.out.println( "onCameraActivity change " + property.getKey() + " to " + property.getValue() + ", Properties version:" + property.getVersion()); } }
@Override public void TwinPropertyCallBack(Property property, Object context) { System.out.println( "onProperty callback for " + (property.getIsReported()?"reported": "desired") + " property " + property.getKey() + " to " + property.getValue() + ", Properties version:" + property.getVersion()); } }
/** * Creates a pretty print JSON with the content of this class and subclasses. * * @return The {@code String} with the pretty print JSON. */ @Override public String toString() { /* Codes_SRS_Property_21_011: [The toString shall return a String with the information in this class in a pretty print JSON.] */ return getKey() + " - " + getValue(); } }
@Override public void PropertyCall(String propertyKey, Object propertyValue, Object context) { PropertyState propertyState = (PropertyState) context; if (propertyKey.equals(propertyState.property.getKey())) { propertyState.callBackTriggered = true; propertyState.propertyNewValue = propertyValue; } }
@Override public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext) { actualStatusUpdates.add(new Pair<>(status, throwable)); } }, new Object());
public String getKey() { /* **Codes_SRS_Property_25_003: [**The function shall return the value of the key corresponding to this property.**]** */ return this.property.getKey(); }
public DeviceTwin(DeviceIO client, DeviceClientConfig config, IotHubEventCallback deviceTwinCallback, Object deviceTwinCallbackContext, PropertyCallBack genericPropertyCallback, Object genericPropertyCallbackContext) { deviceTwinInternal(client, config, deviceTwinCallback, deviceTwinCallbackContext, genericPropertyCallbackContext); /* **Codes_SRS_DEVICETWIN_21_004: [**The constructor shall save the generic property callback.**]** */ this.deviceTwinGenericPropertyChangeCallback = genericPropertyCallback; this.deviceTwinGenericTwinPropertyChangeCallback = null; }
public synchronized void updateReportedProperties(Set<Property> reportedProperties) throws IOException { this.updateReportedProperties(reportedProperties, null); }
@Override public void TwinPropertyCallBack(Property property, Object context) { System.out.println( "onCameraActivity change " + property.getKey() + " to " + property.getValue() + ", Properties version:" + property.getVersion()); } }
@Override public void TwinPropertyCallBack(Property property, Object context) { System.out.println( "onProperty callback for " + (property.getIsReported()?"reported": "desired") + " property " + property.getKey() + " to " + property.getValue() + ", Properties version:" + property.getVersion()); } }
private static Property fetchProperty(Set<Property> expected, String key) { for(Property property: expected) { if(property.getKey().equals(key)) { return property; } } return null; }
@Override public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext) { statusUpdates.add(new Pair<>(status, throwable)); } }, new Object());
public static boolean actualStatusUpdatesContainsStatus(List<Pair<IotHubConnectionStatus, Throwable>> actualStatusUpdates, IotHubConnectionStatus status) { for (int i = 0; i < actualStatusUpdates.size(); i++) { if (actualStatusUpdates.get(i).getKey() == status) { return true; } } return false; } }
public DeviceTwin(DeviceIO client, DeviceClientConfig config, IotHubEventCallback deviceTwinCallback, Object deviceTwinCallbackContext, TwinPropertyCallBack genericPropertyCallback, Object genericPropertyCallbackContext) { deviceTwinInternal(client, config, deviceTwinCallback, deviceTwinCallbackContext, genericPropertyCallbackContext); /* **Codes_SRS_DEVICETWIN_21_004: [**The constructor shall save the generic property callback.**]** */ this.deviceTwinGenericTwinPropertyChangeCallback = genericPropertyCallback; this.deviceTwinGenericPropertyChangeCallback = null; }
@Override public void TwinPropertyCallBack(Property property, Object context) { System.out.println( "onHomeTempChange change " + property.getKey() + " to " + property.getValue() + ", Properties version:" + property.getVersion()); } }
@Override public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason, Throwable throwable, Object callbackContext) { connectionStatusUpdates.add(new Pair<>(status, throwable)); } }, null);
@Override public void TwinPropertyCallBack(Property property, Object context) { System.out.println( "onHomeTempChange change " + property.getKey() + " to " + property.getValue() + ", Properties version:" + property.getVersion()); } }