Class OptionsBuilder
java.lang.Object
org.springframework.data.couchbase.core.query.OptionsBuilder
Methods for building Options objects for Couchbae APIs.
- Author:
- Michael Reiche, Tigran Babloyan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation,
V>
Aannotation
(Class<A> annotation, String attributeName, V defaultValue, AnnotatedElement... elements) return the first merged annotation which does not have attribute with null/defaultValue from the listed elements.static <A extends Annotation,
V>
Aannotation
(Class<A> annotation, V defaultValue, AnnotatedElement[] elements) static <A extends Annotation,
V>
VannotationAttribute
(Class<A> annotation, String attributeName, V defaultValue, AnnotatedElement[] elements) return the first merged annotation which is not null/defaultValue from the listed elements.static <A extends Annotation>
StringannotationString
(Class<A> annotation, Object defaultValue, AnnotatedElement[] elements) static <A extends Annotation>
StringannotationString
(Class<A> annotation, String attributeName, Object defaultValue, AnnotatedElement[] elements) return the toString() of the first merged annotation which is not null/defaultValue from the listed elements.static com.couchbase.client.java.kv.ExistsOptions
buildExistsOptions
(com.couchbase.client.java.kv.ExistsOptions options) static com.couchbase.client.java.kv.InsertOptions
buildInsertOptions
(com.couchbase.client.java.kv.InsertOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, CouchbaseDocument doc) static Meta
buildMeta
(CouchbaseQueryMethod method, Class<?> typeToRead) static com.couchbase.client.java.kv.MutateInOptions
buildMutateInOptions
(com.couchbase.client.java.kv.MutateInOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, CouchbaseDocument doc, Long cas) static com.couchbase.client.java.kv.RemoveOptions
buildRemoveOptions
(com.couchbase.client.java.kv.RemoveOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Long cas) static com.couchbase.client.java.kv.ReplaceOptions
buildReplaceOptions
(com.couchbase.client.java.kv.ReplaceOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, Long cas, CouchbaseDocument doc) static com.couchbase.client.java.transactions.TransactionQueryOptions
buildTransactionQueryOptions
(com.couchbase.client.java.query.QueryOptions options) static com.couchbase.client.java.kv.UpsertOptions
buildUpsertOptions
(com.couchbase.client.java.kv.UpsertOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, CouchbaseDocument doc) static <T> T
Get the most-specificstatic String
getCollectionFrom
(Class<?> domainType) collection annotationstatic com.couchbase.client.core.msg.kv.DurabilityLevel
getDurabilityLevel
(Class<?> domainType) static com.couchbase.client.java.kv.PersistTo
getPersistTo
(Class<?> domainType) static com.couchbase.client.java.json.JsonObject
getQueryOpts
(com.couchbase.client.java.query.QueryOptions.Built optsBuilt) static com.couchbase.client.java.kv.ReplicateTo
getReplicateTo
(Class<?> domainType) static String
getScopeFrom
(Class<?> domainType) scope annotation
-
Constructor Details
-
OptionsBuilder
public OptionsBuilder()
-
-
Method Details
-
buildTransactionQueryOptions
public static com.couchbase.client.java.transactions.TransactionQueryOptions buildTransactionQueryOptions(com.couchbase.client.java.query.QueryOptions options) -
buildExistsOptions
public static com.couchbase.client.java.kv.ExistsOptions buildExistsOptions(com.couchbase.client.java.kv.ExistsOptions options) -
buildInsertOptions
public static com.couchbase.client.java.kv.InsertOptions buildInsertOptions(com.couchbase.client.java.kv.InsertOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, CouchbaseDocument doc) -
buildUpsertOptions
public static com.couchbase.client.java.kv.UpsertOptions buildUpsertOptions(com.couchbase.client.java.kv.UpsertOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, CouchbaseDocument doc) -
buildMutateInOptions
public static com.couchbase.client.java.kv.MutateInOptions buildMutateInOptions(com.couchbase.client.java.kv.MutateInOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, CouchbaseDocument doc, Long cas) -
buildReplaceOptions
public static com.couchbase.client.java.kv.ReplaceOptions buildReplaceOptions(com.couchbase.client.java.kv.ReplaceOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Duration expiry, Long cas, CouchbaseDocument doc) -
buildRemoveOptions
public static com.couchbase.client.java.kv.RemoveOptions buildRemoveOptions(com.couchbase.client.java.kv.RemoveOptions options, com.couchbase.client.java.kv.PersistTo persistTo, com.couchbase.client.java.kv.ReplicateTo replicateTo, com.couchbase.client.core.msg.kv.DurabilityLevel durabilityLevel, Long cas) -
getScopeFrom
scope annotation- Parameters:
domainType
-- Returns:
-
getDurabilityLevel
public static com.couchbase.client.core.msg.kv.DurabilityLevel getDurabilityLevel(Class<?> domainType) -
getPersistTo
-
getReplicateTo
-
getCollectionFrom
collection annotation- Parameters:
domainType
-- Returns:
-
getQueryOpts
public static com.couchbase.client.java.json.JsonObject getQueryOpts(com.couchbase.client.java.query.QueryOptions.Built optsBuilt) -
fromFirst
Get the most-specific- Type Parameters:
T
-- Parameters:
deflt
- the default value, which we treat as not setchoice
- array of values or Optional<values>, ordered from most to least specific- Returns:
- the most specific choice
-
buildMeta
-
annotation
public static <A extends Annotation,V> A annotation(Class<A> annotation, String attributeName, V defaultValue, AnnotatedElement... elements) return the first merged annotation which does not have attribute with null/defaultValue from the listed elements.- Type Parameters:
A
-- Parameters:
annotation
-attributeName
-defaultValue
-elements
-- Returns:
-
annotation
public static <A extends Annotation,V> A annotation(Class<A> annotation, V defaultValue, AnnotatedElement[] elements) -
annotationAttribute
public static <A extends Annotation,V> V annotationAttribute(Class<A> annotation, String attributeName, V defaultValue, AnnotatedElement[] elements) return the first merged annotation which is not null/defaultValue from the listed elements.- Type Parameters:
A
-- Parameters:
annotation
-defaultValue
-elements
-- Returns:
-
annotationString
public static <A extends Annotation> String annotationString(Class<A> annotation, String attributeName, Object defaultValue, AnnotatedElement[] elements) return the toString() of the first merged annotation which is not null/defaultValue from the listed elements.- Type Parameters:
A
-- Parameters:
annotation
-defaultValue
-elements
-- Returns:
-
annotationString
public static <A extends Annotation> String annotationString(Class<A> annotation, Object defaultValue, AnnotatedElement[] elements)
-