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

com.pubnub.internal.endpoints.files.requiredparambuilder.ChannelFileNameFileIdBuilder Maven / Gradle / Ivy

package com.pubnub.internal.endpoints.files.requiredparambuilder;

import com.pubnub.api.endpoints.BuilderSteps.ChannelStep;
import com.pubnub.api.endpoints.files.requiredparambuilder.FilesBuilderSteps.FileIdStep;
import com.pubnub.api.endpoints.files.requiredparambuilder.FilesBuilderSteps.FileNameStep;
import kotlin.jvm.functions.Function3;

public abstract class ChannelFileNameFileIdBuilder implements
        ChannelStep>> {
    private final ChannelStep>> builder;

    public ChannelFileNameFileIdBuilder(ChannelStep>> builder) {
        this.builder = builder;
    }

    public static  ChannelStep>> create(Function3 lastStep) {
        return new InnerBuilder<>(lastStep);
    }

    @Override
    public FileNameStep> channel(String channel) {
        return builder.channel(channel);
    }

    public static class InnerBuilder implements
            ChannelStep>>,
            FileNameStep>,
            FileIdStep {
        private final Function3 lastStep;
        private String channelValue;
        private String fileNameValue;

        private InnerBuilder(Function3 lastStep) {
            this.lastStep = lastStep;
        }

        @Override
        public FileNameStep> channel(String channel) {
            this.channelValue = channel;
            return this;
        }

        @Override
        public FileIdStep fileName(String fileName) {
            this.fileNameValue = fileName;
            return this;
        }

        @Override
        public T fileId(String fileId) {
            return lastStep.invoke(channelValue, fileNameValue, fileId);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy