All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.sdk.result.GenericCollectionExtractor Maven / Gradle / Ivy

/*
 * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
 */

package com.sap.cloud.sdk.result;

import java.util.Collections;
import java.util.List;

import lombok.RequiredArgsConstructor;

/**
 * Extracts a {@code Collection} out of a given {@code ResultElement} by wrapping the result of an
 * {@code ObjectExtractor} into a {@code singletonList}.
 * 
 * @param 
 *            The type of the content of the list to create.
 */
@RequiredArgsConstructor
public class GenericCollectionExtractor implements CollectionExtractor, T>
{
    private final ObjectExtractor extractor;

    @Override
    public List extract( final ResultElement resultElement )
    {
        return Collections.singletonList(extractor.extract(resultElement));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy