Package com.couchbase.lite
Class AbstractJFleeceCollection<T extends com.couchbase.lite.internal.fleece.MCollection>
java.lang.Object
com.couchbase.lite.internal.BaseJFleeceCollection
com.couchbase.lite.AbstractJFleeceCollection<T>
- Type Parameters:
T- the type of the backing collection
- All Implemented Interfaces:
com.couchbase.lite.internal.fleece.FleeceEncodable,com.couchbase.lite.internal.fleece.JSONEncodable,JFleeceCollectionInterface
- Direct Known Subclasses:
Array,Dictionary
@Internal("This class in not part of the public API")
public abstract class AbstractJFleeceCollection<T extends com.couchbase.lite.internal.fleece.MCollection>
extends com.couchbase.lite.internal.BaseJFleeceCollection
implements JFleeceCollectionInterface, com.couchbase.lite.internal.fleece.JSONEncodable, com.couchbase.lite.internal.fleece.FleeceEncodable
AbstractJFleeceCollection is the implementation of JFleeceCollectionInterface common to Array and Dictionary.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcount()voidencodeTo(com.couchbase.lite.internal.fleece.FLEncoder enc) booleanisEmpty()protected ObjecttoJSON()Encode an Array as a JSON stringabstract AbstractJFleeceCollection<T>protected booleanwillMutate(Object newValue, com.couchbase.lite.internal.fleece.MValue oldValue, com.couchbase.lite.internal.fleece.MCollection container) Methods inherited from class com.couchbase.lite.internal.BaseJFleeceCollection
asArray, asBlob, asBoolean, asDictionary, asNumber, asString, asValue, toBoolean, toDouble, toDouble, toFloat, toFloat, toInteger, toInteger, toJFleeceCollection, toLong, toLong
-
Field Details
-
lock
-
contents
-
-
Constructor Details
-
AbstractJFleeceCollection
-
-
Method Details
-
toMutable
-
count
public int count()- Specified by:
countin interfaceJFleeceCollectionInterface
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceJFleeceCollectionInterface
-
toJFleece
- Overrides:
toJFleecein classcom.couchbase.lite.internal.BaseJFleeceCollection
-
encodeTo
public void encodeTo(@NonNull com.couchbase.lite.internal.fleece.FLEncoder enc) - Specified by:
encodeToin interfacecom.couchbase.lite.internal.fleece.FleeceEncodable
-
toJSON
Encode an Array as a JSON string- Specified by:
toJSONin interfacecom.couchbase.lite.internal.fleece.JSONEncodable- Returns:
- JSON encoded representation of the Array
- Throws:
CouchbaseLiteException- on encoder failure.
-
willMutate
protected boolean willMutate(Object newValue, @NonNull com.couchbase.lite.internal.fleece.MValue oldValue, com.couchbase.lite.internal.fleece.MCollection container)
-