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
    Modifier and Type
    Field
    Description
    protected final T
     
    protected final Object
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    void
    encodeTo(com.couchbase.lite.internal.fleece.FLEncoder enc)
     
    boolean
     
    protected Object
     
    Encode an Array as a JSON string
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lock

      @NonNull protected final Object lock
    • contents

      @NonNull protected final T extends com.couchbase.lite.internal.fleece.MCollection contents
  • Constructor Details

    • AbstractJFleeceCollection

      protected AbstractJFleeceCollection(@NonNull T collection)
  • Method Details

    • toMutable

      @NonNull public abstract AbstractJFleeceCollection<T> toMutable()
    • count

      public int count()
      Specified by:
      count in interface JFleeceCollectionInterface
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface JFleeceCollectionInterface
    • toJFleece

      @Nullable protected Object toJFleece(@Nullable Object value)
      Overrides:
      toJFleece in class com.couchbase.lite.internal.BaseJFleeceCollection
    • encodeTo

      public void encodeTo(@NonNull com.couchbase.lite.internal.fleece.FLEncoder enc)
      Specified by:
      encodeTo in interface com.couchbase.lite.internal.fleece.FleeceEncodable
    • toJSON

      @NonNull public String toJSON() throws CouchbaseLiteException
      Encode an Array as a JSON string
      Specified by:
      toJSON in interface com.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)