com.sap.cloud.sdk.result.CollectedResultCollection Maven / Gradle / Ivy
/*
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.sap.cloud.sdk.result;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
/**
* A collection consisting of elements collected by their {@code ElementName} via the
* {@link ResultCollection#collect(String)} method. This class offers several methods to access the content in a
* strongly typed manner.
*
* @see ResultCollection
*/
public interface CollectedResultCollection
{
/**
* Returns a list of values from this instance. The values are represented as an object of the given type.
*
* Important: In order to deserialize a result element to an object of a given type, you have to
* annotate all relevant field members of the respective class with {@link ElementName}. For example:
*
*
* class MyObject
* {
* {@literal @}ElementName( "MANDT" )
* SapClient sapClient;
* }
*
*
*
* @param
* The type into which the values should be converted.
* @param objectType
* Class object of the type into which the values should be converted.
*
* @return The list of values as objects of type {@code T}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asList( @Nonnull final Class objectType )
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as an object of the given type.
*
* Important: In order to deserialize a result element to an object of a given type, you have to
* annotate all relevant field members of the respective class with {@link ElementName}. For example:
*
*
* class MyObject
* {
* {@literal @}ElementName( "MANDT" )
* SapClient sapClient;
* }
*
*
*
* @param
* The type into which the values should be converted.
* @param objectType
* Class object of the type into which the values should be converted.
*
* @return The set of values as objects of type {@code T}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asSet( @Nonnull final Class objectType )
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Boolean}.
*
* @return The list of values as {@code Boolean}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asBooleanList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Boolean}.
*
* @return The set of values as {@code Boolean}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asBooleanSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Byte}.
*
* @return The list of values as {@code Byte}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asByteList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Byte}.
*
* @return The set of values as {@code Byte}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asByteSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Character}.
*
* @return The list of values as {@code Character}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asCharacterList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Character}.
*
* @return The set of values as {@code Character}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asCharacterSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code String}.
*
* @return The list of values as {@code String}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asStringList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code String}.
*
* @return The set of values as {@code String}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asStringSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Integer}.
*
* @return The list of values as {@code Integer}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asIntegerList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Integer}.
*
* @return The set of values as {@code Integer}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asIntegerSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Short}.
*
* @return The list of values as {@code Short}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asShortList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Short}.
*
* @return The set of values as {@code Short}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asShortSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Long}.
*
* @return The list of values as {@code Long}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asLongList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Long}.
*
* @return The set of values as {@code Long}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asLongSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Float}.
*
* @return The list of values as {@code Float}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asFloatList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Float}.
*
* @return The set of values as {@code Float}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asFloatSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code Double}.
*
* @return The list of values as {@code Double}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asDoubleList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code Double}.
*
* @return The set of values as {@code Double}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asDoubleSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code BigInteger}.
*
* @return The list of values as {@code BigInteger}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asBigIntegerList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code BigInteger}.
*
* @return The set of values as {@code BigInteger}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asBigIntegerSet()
throws UnsupportedOperationException;
/**
* Returns a list of values from this instance. The values are represented as {@code BigDecimal}.
*
* @return The list of values as {@code BigDecimal}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
List asBigDecimalList()
throws UnsupportedOperationException;
/**
* Returns a set of values from this instance. The values are represented as {@code BigDecimal}.
*
* @return The set of values as {@code BigDecimal}.
*
* @throws UnsupportedOperationException
* If the value could not be found or could not be converted to the given type.
*/
@Nonnull
Set asBigDecimalSet()
throws UnsupportedOperationException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy