io.sphere.sdk.customobjects.queries.CustomObjectQuery Maven / Gradle / Ivy
package io.sphere.sdk.customobjects.queries;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import io.sphere.sdk.customobjects.CustomObject;
import io.sphere.sdk.customobjects.expansion.CustomObjectExpansionModel;
import io.sphere.sdk.json.TypeReferences;
import io.sphere.sdk.queries.MetaModelQueryDsl;
/**
* Queries custom objects.
*
*
*
*
* {@include.example io.sphere.sdk.customobjects.queries.CustomObjectQueryIntegrationTest#queryByContainer()}
*
* @param The type of the value of this custom object.
* @see CustomObject
*/
public interface CustomObjectQuery extends MetaModelQueryDsl, CustomObjectQuery, CustomObjectQueryModel>, CustomObjectExpansionModel>> {
/**
* Query object for custom objects where the result value is a POJO.
* @param valueTypeReference the type reference of the value of the custom object
* @param the Java type of the value of the custom object
* @return query object
*/
static CustomObjectQuery of(final TypeReference valueTypeReference) {
return new CustomObjectQueryImpl<>(valueTypeReference);
}
/**
* Query object for custom objects where the result value is a POJO.
* @param valueClass the class of the value, if it not uses generics like lists, typically for POJOs
* @param the Java type of the value of the custom object
* @return query object
*/
static CustomObjectQuery of(final Class valueClass) {
return new CustomObjectQueryImpl<>(valueClass);
}
static CustomObjectQuery ofJsonNode() {
return of(TypeReferences.jsonNodeTypeReference());
}
default CustomObjectQuery byContainer(final String container) {
return withPredicates(m -> m.container().is(container));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy