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 TypeMethodDescriptionint
count()
void
encodeTo
(com.couchbase.lite.internal.fleece.FLEncoder enc) boolean
isEmpty()
protected Object
toJSON()
Encode an Array as a JSON stringabstract AbstractJFleeceCollection<T>
protected boolean
willMutate
(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:
count
in interfaceJFleeceCollectionInterface
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceJFleeceCollectionInterface
-
toJFleece
- Overrides:
toJFleece
in classcom.couchbase.lite.internal.BaseJFleeceCollection
-
encodeTo
public void encodeTo(@NonNull com.couchbase.lite.internal.fleece.FLEncoder enc) - Specified by:
encodeTo
in interfacecom.couchbase.lite.internal.fleece.FleeceEncodable
-
toJSON
Encode an Array as a JSON string- Specified by:
toJSON
in 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)
-