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

com.haoxuer.discover.plug.data.entity.PluginConfig Maven / Gradle / Ivy

There is a newer version: 3.3.18-20230117
Show newest version
/*
 * 
 * 
 * 
 */

package com.haoxuer.discover.plug.data.entity;

import com.haoxuer.discover.data.entity.SortEntity;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.MapKeyColumn;
import javax.persistence.Table;

/**
 * Entity - 插件配置
 */
@Entity
@Table(name = "plugin_config")
public class PluginConfig extends SortEntity {
  
  private static final long serialVersionUID = -4357367409438384806L;
  
  /**
   * 插件ID
   */
  @Column(nullable = false, updatable = false, unique = true, length = 100)
  private String pluginId;
  
  /**
   * 是否启用
   */
  @Column(nullable = false)
  private Boolean isEnabled;
  
  /**
   * 属性
   */
  @ElementCollection(fetch = FetchType.EAGER)
  @CollectionTable(name = "plugin_config_attribute")
  @MapKeyColumn(name = "name", length = 100)
  private Map attributes = new HashMap();
  
  /**
   * 获取插件ID
   *
   * @return 插件ID
   */
  public String getPluginId() {
    return pluginId;
  }
  
  /**
   * 设置插件ID
   *
   * @param pluginId 插件ID
   */
  public void setPluginId(String pluginId) {
    this.pluginId = pluginId;
  }
  
  /**
   * 获取是否启用
   *
   * @return 是否启用
   */
  public Boolean getIsEnabled() {
    return isEnabled;
  }
  
  /**
   * 设置是否启用
   *
   * @param isEnabled 是否启用
   */
  public void setIsEnabled(Boolean isEnabled) {
    this.isEnabled = isEnabled;
  }
  
  /**
   * 获取属性
   *
   * @return 属性
   */
  public Map getAttributes() {
    return attributes;
  }
  
  /**
   * 设置属性
   *
   * @param attributes 属性
   */
  public void setAttributes(Map attributes) {
    this.attributes = attributes;
  }
  
  /**
   * 获取属性值
   *
   * @param name 属性名称
   * @return 属性值
   */
  public String getAttribute(String name) {
    if (getAttributes() != null && name != null) {
      return getAttributes().get(name);
    } else {
      return "";
    }
  }
  
  /**
   * 设置属性值
   *
   * @param name  属性名称
   * @param value 属性值
   */
  public void setAttribute(String name, String value) {
    if (getAttributes() != null && name != null) {
      getAttributes().put(name, value);
    }
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy