Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. for (Property property : this.getProperties().values()) {
  2. ValueCollection propParam = new ValueCollection();
  3. PropertyDefinition propertyDefinition = property.getPropertyDefinition();
  4.  
  5. propParam.put("name", new StringPrimitive(propertyDefinition.getName()));
  6. propParam.put("type", new StringPrimitive(propertyDefinition.getBaseType().name()));
  7. propParam.put("defaultValue", propertyDefinition.getDefaultValue());
  8. propParam.put("readOnly", new BooleanPrimitive(propertyDefinition.isReadOnly()));
  9. propParam.put("persistent", new BooleanPrimitive(propertyDefinition.isPersistent()));
  10. propParam.put("logged", new BooleanPrimitive(propertyDefinition.isLogged()));
  11. propParam.put("dataChangeType", new StringPrimitive(propertyDefinition.getDataChangeType().name()));
  12. propParam.put("dataChangeThreshold", new NumberPrimitive(propertyDefinition.getDataChangeThreshold()));
  13. propParam.put("remote", new BooleanPrimitive(true));
  14. propParam.put("remotePropertyName", new StringPrimitive(propertyDefinition.getName()));
  15.  
  16. client.invokeService(Things, name, "AddPropertyDefinition", propParam, 1000);
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement