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

com.pubnub.api.java.builder.PubSubBuilder Maven / Gradle / Ivy

package com.pubnub.api.java.builder;


import com.pubnub.api.PubNub;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

public abstract class PubSubBuilder {

    @Getter(AccessLevel.PROTECTED)
    @Setter(AccessLevel.PROTECTED)
    private List channelSubscriptions;

    @Getter(AccessLevel.PROTECTED)
    @Setter(AccessLevel.PROTECTED)
    private List channelGroupSubscriptions;

    @Getter(AccessLevel.PROTECTED)
    @Setter(AccessLevel.PROTECTED)
    private PubNub pubnub;

    public PubSubBuilder(PubNub pubnub) {
        this.pubnub = pubnub;
        this.channelSubscriptions = new ArrayList<>();
        this.channelGroupSubscriptions = new ArrayList<>();
    }


    public PubSubBuilder channels(List channel) {
        channelSubscriptions.addAll(channel);
        return this;
    }

    public PubSubBuilder channelGroups(List channelGroup) {
        channelGroupSubscriptions.addAll(channelGroup);
        return this;
    }

    public abstract void execute();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy