Class JsonLongDocument

java.lang.Object
com.couchbase.client.java.document.AbstractDocument<Long>
com.couchbase.client.java.document.JsonLongDocument
All Implemented Interfaces:
Document<Long>, Serializable

public class JsonLongDocument
extends AbstractDocument<Long>
implements Serializable
Stores a properly encoded JSON scalar long or int as the toplevel type. This document works exactly like JsonDocument, but it accepts a different toplevel type. This document is interoperable with other SDKs.
Since:
2.0
Author:
Michael Nitschinger
See Also:
Serialized Form
  • Method Details

    • create

      public static JsonLongDocument create​(String id)
      Creates a JsonLongDocument which the document id.
      Parameters:
      id - the per-bucket unique document id.
      Returns:
      a JsonLongDocument.
    • create

      public static JsonLongDocument create​(String id, Long content)
      Creates a JsonLongDocument which the document id and content.
      Parameters:
      id - the per-bucket unique document id.
      content - the content of the document.
      Returns:
      a JsonLongDocument.
    • create

      public static JsonLongDocument create​(String id, Long content, long cas)
      Creates a JsonLongDocument which the document id, content and the CAS value.
      Parameters:
      id - the per-bucket unique document id.
      content - the content of the document.
      cas - the CAS (compare and swap) value for optimistic concurrency.
      Returns:
      a JsonLongDocument.
    • create

      public static JsonLongDocument create​(String id, int expiry, Long content)
      Creates a JsonLongDocument which the document id, content and the expiration time.
      Parameters:
      id - the per-bucket unique document id.
      content - the content of the document.
      expiry - the expiration time of the document.
      Returns:
      a JsonLongDocument.
    • create

      public static JsonLongDocument create​(String id, int expiry, Long content, long cas)
      Creates a JsonLongDocument which the document id, content, CAS value, expiration time and status code. This factory method is normally only called within the client library when a response is analyzed and a document is returned which is enriched with the status code. It does not make sense to pre populate the status field from the user level code.
      Parameters:
      id - the per-bucket unique document id.
      content - the content of the document.
      cas - the CAS (compare and swap) value for optimistic concurrency.
      expiry - the expiration time of the document.
      Returns:
      a JsonLongDocument.
    • create

      public static JsonLongDocument create​(String id, int expiry, Long content, long cas, MutationToken mutationToken)
      Creates a JsonLongDocument which the document id, content, CAS value, expiration time and status code. This factory method is normally only called within the client library when a response is analyzed and a document is returned which is enriched with the status code. It does not make sense to pre populate the status field from the user level code.
      Parameters:
      id - the per-bucket unique document id.
      content - the content of the document.
      cas - the CAS (compare and swap) value for optimistic concurrency.
      expiry - the expiration time of the document.
      Returns:
      a JsonLongDocument.
    • from

      public static JsonLongDocument from​(JsonLongDocument doc, String id)
      Creates a copy from a different JsonLongDocument, but changes the document ID.
      Parameters:
      doc - the original JsonLongDocument to copy.
      id - the per-bucket unique document id.
      Returns:
      a copied JsonLongDocument with the changed properties.
    • from

      public static JsonLongDocument from​(JsonLongDocument doc, Long content)
      Creates a copy from a different JsonLongDocument, but changes the content.
      Parameters:
      doc - the original JsonLongDocument to copy.
      content - the content of the document.
      Returns:
      a copied JsonLongDocument with the changed properties.
    • from

      public static JsonLongDocument from​(JsonLongDocument doc, String id, Long content)
      Creates a copy from a different JsonLongDocument, but changes the document ID and content.
      Parameters:
      doc - the original JsonLongDocument to copy.
      id - the per-bucket unique document id.
      content - the content of the document.
      Returns:
      a copied JsonLongDocument with the changed properties.
    • from

      public static JsonLongDocument from​(JsonLongDocument doc, long cas)
      Creates a copy from a different JsonLongDocument, but changes the CAS value.
      Parameters:
      doc - the original JsonLongDocument to copy.
      cas - the CAS (compare and swap) value for optimistic concurrency.
      Returns:
      a copied JsonLongDocument with the changed properties.