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

com.github.houbb.config.socket.client.rpc.dto.RpcAddress Maven / Gradle / Ivy

There is a newer version: 1.7.1
Show newest version
package com.github.houbb.config.socket.client.rpc.dto;

/**
 * 地址信息
 * @author binbin.hou
 * @since 1.0.0
 */
public class RpcAddress {

    /**
     * address 信息
     * @since 1.0.0
     */
    private String address;

    /**
     * 端口号
     * @since 1.0.0
     */
    private int port;

    /**
     * 权重
     * @since 1.0.0
     */
    private int weight;

    public RpcAddress(String address, int port) {
        this.address = address;
        this.port = port;
        this.weight = 1;
    }

    public RpcAddress(String address, int port, int weight) {
        this.address = address;
        this.port = port;
        this.weight = weight;
    }

    public String address() {
        return address;
    }

    public RpcAddress address(String address) {
        this.address = address;
        return this;
    }

    public int port() {
        return port;
    }

    public RpcAddress port(int port) {
        this.port = port;
        return this;
    }

    public int weight() {
        return weight;
    }

    public RpcAddress weight(int weight) {
        this.weight = weight;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy