package com.bonus.core.data.dataset.rule.loader;


import com.bonus.core.common.utils.TenantContextHolder;

public interface RouterLoader {
   Router load(Object key);

   default Object getRouterKey() {
      return TenantContextHolder.getTenantId();
   }

   public static class Router {
      private String dataset;
      private String schema;
      private boolean schemaMode;

      public Router(String dataset, String schema) {
         this.dataset = dataset;
         this.schema = schema;
      }

      public String getDataset() {
         return this.dataset;
      }

      public String getSchema() {
         return this.schema;
      }

      public boolean isSchemaMode() {
         return this.schemaMode;
      }

      public void setDataset(final String dataset) {
         this.dataset = dataset;
      }

      public void setSchema(final String schema) {
         this.schema = schema;
      }

      public void setSchemaMode(final boolean schemaMode) {
         this.schemaMode = schemaMode;
      }

      public Router(final String dataset, final String schema, final boolean schemaMode) {
         this.dataset = dataset;
         this.schema = schema;
         this.schemaMode = schemaMode;
      }

      public Router() {
      }
   }
}
