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

com.dottydingo.hyperion.client.builder.UpdateCollectionRequestBuilder Maven / Gradle / Ivy

The newest version!
package com.dottydingo.hyperion.client.builder;

import com.dottydingo.hyperion.api.ApiObject;
import com.dottydingo.hyperion.api.EntityList;
import com.dottydingo.hyperion.client.*;

import java.io.Serializable;
import java.util.List;

/**
 * A request builder for updating multiple items
 */
public class UpdateCollectionRequestBuilder,ID extends Serializable>
        extends UpdateRequestBuilder
{

    /**
     * Create the request builder using the specified parameters
     * @param version The entity version
     * @param objectType The API type
     * @param entityName The entity name
     * @param entries The entries to update
     */
    public UpdateCollectionRequestBuilder(int version, Class objectType, String entityName, List entries)
    {
        super(version, objectType, entityName, entries);

    }

    @Override
    public UpdateCollectionRequestBuilder returnFields(String... fields)
    {
        super.returnFields(fields);
        return this;
    }

    @Override
    public UpdateCollectionRequestBuilder addParameter(String name, String value)
    {
        super.addParameter(name, value);
        return this;
    }

    @Override
    public UpdateCollectionRequestBuilder setParameter(String name, String value)
    {
        super.setParameter(name, value);
        return this;
    }

    @Override
    public UpdateCollectionRequestBuilder addHeader(String name, String value)
    {
        super.addHeader(name, value);
        return this;
    }

    @Override
    public UpdateCollectionRequestBuilder setHeader(String name, String value)
    {
        super.setHeader(name, value);
        return this;
    }

    @Override
    public UpdateCollectionRequestBuilder withHeaderFactory(HeaderFactory headerFactory)
    {
        super.withHeaderFactory(headerFactory);
        return this;
    }

    @Override
    public UpdateCollectionRequestBuilder withParameterFactory(ParameterFactory parameterFactory)
    {
        super.withParameterFactory(parameterFactory);
        return this;
    }

    /**
     * Execute the request using the supplied client
     * @param client the client
     * @return The request
     */
    public List execute(HyperionClient client)
    {
        EntityList entityResponse = client.update(build());
        return entityResponse.getEntries();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy