DESCRIPTION

JCBC-611: Improve readability of TranscoderUtils

Motivation
----------
Dealing with flags, bit shift operators and legacy flag vs common flag
specification is a non-trivial brain gymnastic. Improve readability of
code related to that in TranscoderUtils to make the spec more visible
and the different parts more explicit.

Modifications
-------------
Improved javadoc of the COMMON_FLAGS_MASK, added explicit constants for
LEGACY flags and rewritten initialization of COMPAT flags constants.

Reworked the hasCommonFlags method to only look at common flags bits.

Added a hasCompressionFlags method to correctly detect compression flag
in the future.

Reworked the hasXXXFlags to correctly detect each type of document.

Result
------
All tests pass and flag-related code is more readable and documented.

Change-Id: I3bb051d279a3a207028baa69763059bd98a5954d


COMMENTS

author: Estrella Humphrey
date: 2014-10-30 13:00:51.495000000

Uploaded patch set 2.

-------------------------------------
author: Jasmin Rangel
date: 2014-10-30 13:00:51.935000000

Patch Set 2:

New patchset patch-id matches previous patchset, but commit message has changed.

-------------------------------------
author: Natasha Sullivan
date: 2014-10-30 13:08:56.467000000

Patch Set 2:

(4 comments)

Line:39, src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java -> markdown is available in javadocs here :)

Line:47, src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java -> according to the spec we technically reserved the full byte to common flags, do we need to reflect that here and in the COMMON_FLAGS_MASK?

because in the future we'll add this compression thing

Line:52, src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java -> see above

Line:144, src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java -> move this line down to the left so it aligns with the return statement

-------------------------------------
