UpdateCounter.Builder Class
A builder for constructing UpdateCounter instances.
Rather than having to manually construct the options and instantiating a UpdateCounter directly, this builder may be used.
var update = new UpdateCounter.Builder()
          .withBucketType('counters')
          .withBucket('myBucket')
          .withKey('counter_1')
          .withIncrement(100)
          .withCallback(callback)
          .build();
Constructor
UpdateCounter.Builder
        ()
    
    Item Index
Methods
build
        ()
        
            UpdateCounter
        
    
    Construct a UpdateCounter instance.
Returns:
a UpdateCounter instance
withBucket
        - 
                        
bucket 
Set the bucket.
Parameters:
- 
                        
bucketStringthe bucket in Riak
 
withBucketType
        - 
                        
bucketType 
Set the bucket type.
Parameters:
- 
                        
bucketTypeStringthe bucket type in riak
 
withCallback
        - 
                        
callback 
Set the callback to be executed when the operation completes.
Parameters:
- 
                        
callbackFunctionThe callback to be executed when the operation completes.
- 
                                    
errStringAn error message. Will be null if no error.
 - 
                                    
responseObjectThe response from Riak. Will ne null if returnBody not set.
- 
                                                
generatedKeyStringIf no key was supplied, Riak will generate and return one here. - 
                                                
counterValueNumberThe value of the counter in Riak. 
 - 
                                                
 
 - 
                                    
 
withDw
        - 
                        
dw 
Set the DW value. How many replicas to commit to durable storage before returning a successful response. If not set the bucket default is used.
Parameters:
- 
                        
dwNumberthe DW value.
 
withIncrement
        - 
                        
increment 
Set the increment to apply to this counter. This may be negative as well as positive.
Parameters:
- 
                        
incrementNumberthe amount to increment (negative to decrement)
 
withKey
        - 
                        
key 
Set the key. If not set Riak will generate one.
Parameters:
- 
                        
keyStringthe key in riak.
 
withPw
        - 
                        
pw 
Set the PW value. How many primary nodes must be up when the write is attempted. If not set the bucket default is used.
Parameters:
- 
                        
pwNumberthe PW value.
 
withReturnBody
        - 
                        
returnBody 
Return the counter after updating.
Parameters:
- 
                        
returnBodyBooleantrue to return the counter.
 
withTimeout
        - 
                        
timeout 
Set a timeout for this operation.
Parameters:
- 
                        
timeoutNumbera timeout in milliseconds.
 
withW
        - 
                        
w 
Set the W value. How many replicas to write to before returning a successful response. If not set the bucket default is used.
Parameters:
- 
                        
wNumberthe W value.
 
