package com.zd.system.api.laboratory.domain;

import cn.hutool.core.util.StrUtil;

import java.util.Optional;

/**
 * @Author: zhoupan
 * @Date: 2021/09/27/18:46
 * @Description:
 */
public class SubAddrr {
    /**
     * 布局ID
     */
    Long id;

    Long floorId;
    /**
     * 层
     */
    String floorName;
    /**
     * 楼
     */
    String buildName;
    /**
     * 房间号
     */
    String room;


    private static String addrrFormat = "{} {} {}";

    public static String addrrPlus(SubAddrr subAddrr) {

        if (subAddrr == null) return StrUtil.EMPTY;

        return StrUtil.format(addrrFormat,
                Optional.ofNullable(subAddrr.getBuildName()).orElse(StrUtil.EMPTY),
                Optional.ofNullable(subAddrr.getFloorName()).orElse(StrUtil.EMPTY),
                Optional.ofNullable(subAddrr.getRoom()).orElse(StrUtil.EMPTY));
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFloorName() {
        return floorName;
    }

    public void setFloorName(String floorName) {
        this.floorName = floorName;
    }

    public String getBuildName() {
        return buildName;
    }

    public void setBuildName(String buildName) {
        this.buildName = buildName;
    }

    public String getRoom() {
        return room;
    }

    public void setRoom(String room) {
        this.room = room;
    }

    public Long getFloorId() {
        return floorId;
    }

    public void setFloorId(Long floorId) {
        this.floorId = floorId;
    }
}
