/*
 * This file is generated by jOOQ.
 */
package cn.vertxup.rbac.domain.tables.interfaces;


import io.github.jklingsporn.vertx.jooq.shared.internal.VertxPojo;

import java.io.Serializable;

import static io.github.jklingsporn.vertx.jooq.shared.internal.VertxPojo.setOrThrow;
/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public interface IRUserRole extends VertxPojo, Serializable {

    /**
     * Setter for <code>DB_ETERNAL.R_USER_ROLE.USER_ID</code>. 「userId」- 关联用户ID
     */
    public IRUserRole setUserId(String value);

    /**
     * Getter for <code>DB_ETERNAL.R_USER_ROLE.USER_ID</code>. 「userId」- 关联用户ID
     */
    public String getUserId();

    /**
     * Setter for <code>DB_ETERNAL.R_USER_ROLE.ROLE_ID</code>. 「roleId」- 关联角色ID
     */
    public IRUserRole setRoleId(String value);

    /**
     * Getter for <code>DB_ETERNAL.R_USER_ROLE.ROLE_ID</code>. 「roleId」- 关联角色ID
     */
    public String getRoleId();

    /**
     * Setter for <code>DB_ETERNAL.R_USER_ROLE.PRIORITY</code>. 「priority」-
     * 角色优先级
     */
    public IRUserRole setPriority(Integer value);

    /**
     * Getter for <code>DB_ETERNAL.R_USER_ROLE.PRIORITY</code>. 「priority」-
     * 角色优先级
     */
    public Integer getPriority();

    // -------------------------------------------------------------------------
    // FROM and INTO
    // -------------------------------------------------------------------------

    /**
     * Load data from another generated Record/POJO implementing the common
     * interface IRUserRole
     */
    public void from(IRUserRole from);

    /**
     * Copy data into another generated Record/POJO implementing the common
     * interface IRUserRole
     */
    public <E extends IRUserRole> E into(E into);

        @Override
        public default IRUserRole fromJson(io.vertx.core.json.JsonObject json) {
                setOrThrow(this::setUserId,json::getString,"USER_ID","java.lang.String");
                setOrThrow(this::setRoleId,json::getString,"ROLE_ID","java.lang.String");
                setOrThrow(this::setPriority,json::getInteger,"PRIORITY","java.lang.Integer");
                return this;
        }


        @Override
        public default io.vertx.core.json.JsonObject toJson() {
                io.vertx.core.json.JsonObject json = new io.vertx.core.json.JsonObject();
                json.put("USER_ID",getUserId());
                json.put("ROLE_ID",getRoleId());
                json.put("PRIORITY",getPriority());
                return json;
        }

}
