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

com.volcengine.service.vikingDB.common.CreateCollectionParam Maven / Gradle / Ivy

There is a newer version: 1.0.192
Show newest version
package com.volcengine.service.vikingDB.common;

import lombok.Data;

import java.util.List;

import com.volcengine.service.vikingDB.VikingDBException;
@Data
public class CreateCollectionParam {
    private String collectionName = null;
    private List fields = null;
    private String description = "";
    private Integer isBuild = 0;
    public CreateCollectionParam(){}

    public CreateCollectionParam setCollectionName(String collection_name) {
        this.collectionName = collection_name;
        return this;
    }

    public CreateCollectionParam setFields(List fields) {
        this.fields = fields;
        return this;
    }

    public CreateCollectionParam setDescription(String description) {
        this.description = description;
        return this;
    }
    public CreateCollectionParam build() throws Exception{
        VikingDBException vikingDBException = new VikingDBException(1000030, null, "Params does not exist");
        if(this.collectionName == null){
            throw vikingDBException.getErrorCodeException(1000030, null, "CollectionName does not exist");
        } else if(this.fields == null){
            throw vikingDBException.getErrorCodeException(1000030, null, "Fields does not exist");
        } else {
            this.isBuild = 1;
            return this;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy