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

com.aliyun.datahub.client.common.DatahubConfig Maven / Gradle / Ivy

The newest version!
package com.aliyun.datahub.client.common;

import com.aliyun.datahub.client.auth.Account;

import java.util.Objects;

public class DatahubConfig {

    public enum Protocol {
        PROTOBUF,
        BATCH,
    }

    private String endpoint;
    private Account account;
    private Protocol protocol;

    public DatahubConfig(String endpoint, Account account) {
        this(endpoint, account, Protocol.PROTOBUF);
    }

    public DatahubConfig(String endpoint, Account account, Protocol protocol) {
        this.endpoint = endpoint;
        this.account = account;
        this.protocol = protocol;
    }

    @Deprecated
    public DatahubConfig(String endpoint, Account account, boolean enableBinary) {
        this.endpoint = endpoint;
        this.account = account;
        this.protocol = Protocol.PROTOBUF;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public DatahubConfig setEndpoint(String endpoint) {
        this.endpoint = endpoint;
        return this;
    }

    public Account getAccount() {
        return account;
    }

    public DatahubConfig setAccount(Account account) {
        this.account = account;
        return this;
    }

    public Protocol getProtocol() {
        return protocol;
    }

    public DatahubConfig setProtocol(Protocol protocol) {
        this.protocol = protocol;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DatahubConfig that = (DatahubConfig) o;
        return Objects.equals(endpoint, that.endpoint)
                       && Objects.equals(account, that.account)
                       && protocol == that.protocol;
    }

    @Override
    public int hashCode() {
        return Objects.hash(endpoint, account, protocol);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy