UpdateVerbBuilder class

Update builder generates a command to update value for a key atKey in the secondary server of sharedBy. Use getBuilder method if you want to convert command to a builder.

  • Setting a public value for the key 'phone'

  • When isPublic is set to true, throws InvalidAtKeyException if isLocal is set to true or sharedWith is populated

 var updateBuilder = UpdateVerbBuilder()
 ..isPublic=true
 ..key='phone'
 ..sharedBy='bob'
 ..value='+1-1234';
  • @bob setting a value for the key 'phone' to share with @alice

  • When sharedWith is populated, throws InvalidAtKeyException if isLocal or isPublic is set to true

 var updateBuilder = UpdateVerbBuilder()
 ..sharedWith=’alice’
 ..key='phone'
 ..sharedBy='bob'
 ..value='+1-5678';
  • Creating a local key for storing data that does not sync

  • When isLocal is set to true, throws InvalidAtKeyException if isPublic is set to true or sharedWith is populated

 var updateBuilder = UpdateVerbBuilder()
                     ..isLocal = true
                     ..key = 'preferences'
                     ..sharedBy = '@bob'
                     ..value = jsonEncode(myPrefObj)

Constructors

UpdateVerbBuilder()

Properties

atKey AtKey
Represents the AtKey instance to populate the verb builder data
getter/setter pairinherited
hashCode int
The hash code for this object.
no setteroverride
isJson bool
getter/setter pair
operation String?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ dynamic
Value of the key typically in string format. Images, files, etc., must be converted to unicode string before storing.
getter/setter pair

Methods

buildCommand() String
Build the @ command to be sent to remote secondary for execution.
override
buildCommandForMeta() String
buildKey() String
Get the string representation (e.g. @bob:city.address.my_app@alice) of the key for which this update command is being built.
checkParams() bool
Checks whether all params required by the verb builder are set. Returns false if required params are not set.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateKey() → void
Validates the AtKey
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

getBuilder(String command) UpdateVerbBuilder?