io.camunda.service.search.query.SearchQueryResult Maven / Gradle / Ivy
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
* Licensed under the Camunda License 1.0. You may not use this file
* except in compliance with the Camunda License 1.0.
*/
package io.camunda.service.search.query;
import io.camunda.util.ObjectBuilder;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
public final record SearchQueryResult(long total, List items, Object[] sortValues) {
public static final class Builder implements ObjectBuilder> {
private long total;
private List items;
private Object[] sortValues;
public Builder total(final long value) {
total = value;
return this;
}
public Builder items(final List values) {
items = values;
return this;
}
public Builder sortValues(final Object[] values) {
sortValues = values;
return this;
}
@Override
public SearchQueryResult build() {
return new SearchQueryResult(
total, Objects.requireNonNullElse(items, Collections.emptyList()), sortValues);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy