Allow persistTo and replicateTo to be strings

Description

A CFML SDK should sufficiently abstract users away from the Java details under the hood. Requiring devs to use the PersistTo and ReplicateTo enums serves no purpose and just makes for more code.

couchbaseClient.set( 'ID', 'value', 20, couchbaseClient.PersistTo.ONE, couchbaseClient.ReplcateTo.TWO );

Internalize the enums and allow users to just pass in a string that represents their requirement. Internally, validate and match that string with the proper enum.

couchbaseClient.set( 'ID', 'value', 20, 'one', 'two' );

This applies to set(), setWithCAS(), add(), setMulti(), replace(), and delete(). Wrap the logic to convert the string to the proper enum value in a separate utility function.

Gliffy Diagrams

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Priority

Sentry

Created January 25, 2014 at 9:23 PM
Updated January 28, 2014 at 5:29 AM
Resolved January 28, 2014 at 5:29 AM