io.axoniq.axonserver.connector.event.EventQueryResultEntry Maven / Gradle / Ivy
Show all versions of axonserver-connector-java Show documentation
/*
* Copyright (c) 2020-2021. AxonIQ
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.axoniq.axonserver.connector.event;
import java.util.List;
/**
* Represents a single result from an Event Query.
*
* Entries may represent an update to previous entries. The {@link #getIdentifiers()} result will be equal to the entry
* that it is an update for. The number of entries will be the same for all results of the same query.
*
* If entries represent an ordered result, the {@link #getSortValues()} will return a list of values to sort on. The
* number of values will be equal in all entries for the same query.
*
* @author Allard Buijze
* @since 4.5.1
*/
public interface EventQueryResultEntry {
/**
* The list of columns returned by the query. Will return the same value for all result entries of the same query.
*
* @return the names of the columns returned in this entry
*/
List columns();
/**
* Returns the value for the given {@code column}, casting it to the desired type.
*
* The returned value can be a {@link String}, {@link Double}, {@link Long} or {@link Boolean}
*
* @param column the name of the column to return the data for
* @param the type to cast the result to
* @return the value associated with the given column
*/
R getValue(String column);
/**
* Returns the identifiers that uniquely identify this result entry. When multiple entries have equal identifier,
* the second result entry represents an updated version of the first.
*
* @return the identifiers for this entry
*/
List