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

com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.DefaultCostCenterCreateMultipleFunctionResult Maven / Gradle / Ivy

There is a newer version: 2.28.0
Show newest version
/*
 * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
 */

package com.sap.cloud.sdk.s4hana.datamodel.bapi.functions;

import java.util.List;

import com.google.common.collect.Lists;
import com.sap.cloud.sdk.result.ResultElement;
import com.sap.cloud.sdk.s4hana.connectivity.rfc.BapiQueryResult;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.CostCenterCreateInput;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.RefStructureForParameterExtensioninExtensionout;
import com.sap.cloud.sdk.s4hana.datamodel.bapi.structures.ReturnParameter;

import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@RequiredArgsConstructor
@EqualsAndHashCode
@ToString
public class DefaultCostCenterCreateMultipleFunctionResult
    implements CostCenterCreateMultipleFunctionResult
{

    private final BapiQueryResult result;

    /**
     * See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.CostCenterCreateMultipleFunctionResult#getCostCenters() interface}
     * 
     * @return
     *     Cost Centers
     */
    @Override
    public List getCostCenters() {
        final List list = Lists.newArrayList();
        for (ResultElement row: result.get("COSTCENTERLIST").getAsCollection()) {
            list.add(row.getAsObject().as(CostCenterCreateInput.class));
        }
        return list;
    }

    /**
     * See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.CostCenterCreateMultipleFunctionResult#getAdditionalOutput() interface}
     * 
     * @return
     *     Additional Output
     */
    @Override
    public List getAdditionalOutput() {
        final List list = Lists.newArrayList();
        for (ResultElement row: result.get("EXTENSIONOUT").getAsCollection()) {
            list.add(row.getAsObject().as(RefStructureForParameterExtensioninExtensionout.class));
        }
        return list;
    }

    /**
     * See also the {@link com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.CostCenterCreateMultipleFunctionResult#getMessages() interface}
     * 
     * @return
     *     Return Values
     */
    @Override
    public List getMessages() {
        final List list = Lists.newArrayList();
        for (ResultElement row: result.get("RETURN").getAsCollection()) {
            list.add(row.getAsObject().as(ReturnParameter.class));
        }
        return list;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy