content: package com.aliyun.fastmodel.transform.api.extension.client.constraint;
  
  import com.aliyun.fastmodel.transform.api.client.dto.constraint.ConstraintType;
  import lombok.Getter;
  
  /**
   * StarRocksConstraintType
   *
   * @author panguanjing
   * @date 2023/12/13
   */
  @Getter
  public enum ExtensionClientConstraintType implements ConstraintType {
  
      /**
       * aggregate key
       */
      AGGREGATE_KEY("aggregate_key"),
  
      /**
       * duplicate key
       */
      DUPLICATE_KEY("duplicate_key"),
      /**
       * unique key
       */
      UNIQUE_KEY(com.aliyun.fastmodel.core.tree.statement.constants.ConstraintType.UNIQUE.getCode()),
      /**
       * primary key
       */
      PRIMARY_KEY(com.aliyun.fastmodel.core.tree.statement.constants.ConstraintType.PRIMARY_KEY.getCode()),
  
      /**
       * order by
       */
      ORDER_BY("orderBy"),
  
      /**
       * distribute key
       */
      DISTRIBUTE("distribute"),
  
      /**
       * watermark (flink)
       */
      WATERMARK("watermark"),
  
      /**
       * cluster by
       */
      CLUSTER_BY("clusterBy"),
  
      /**
       * clustered key
       */
      CLUSTERED_KEY("clusteredKey"),
  
      /**
       * 向量索引
       */
      ANN_INDEX("annIndex"),
  
      /**
       * 外键
       */
      FOREIGN_KEY("foreignKey");
  
  
      ;
  
      private final String code;
  
      ExtensionClientConstraintType(String code) {this.code = code;}
  
      @Override
      public String getCode() {
          return code;
      }
  
      public static ExtensionClientConstraintType getByValue(String value) {
          for (ExtensionClientConstraintType starRocksConstraintType : ExtensionClientConstraintType.values()) {
              if (starRocksConstraintType.code.equalsIgnoreCase(value)) {
                  return starRocksConstraintType;
              }
          }
          return null;
      }
  }
  