Package io.milvus.param.highlevel.collection

## Class CreateSimpleCollectionParam.Builder

- java.lang.Object
- - io.milvus.param.highlevel.collection.CreateSimpleCollectionParam.Builder

- Enclosing class:
    CreateSimpleCollectionParam

      public static final class CreateSimpleCollectionParam.Builder
      extends java.lang.Object

  Builder for `CreateSimpleCollectionParam` class.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CreateSimpleCollectionParam` | `build()` | Verifies parameters and creates a new `CreateSimpleCollectionParam` instance.
    `CreateSimpleCollectionParam.Builder` | `withAutoId​(boolean autoId)` | Sets the autoId.
    `CreateSimpleCollectionParam.Builder` | `withCollectionName​(@NonNull java.lang.String collectionName)` | Sets the collection name.
    `CreateSimpleCollectionParam.Builder` | `withConsistencyLevel​(@NonNull ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level.
    `CreateSimpleCollectionParam.Builder` | `withDescription​(@NonNull java.lang.String description)` | Sets the collection description.
    `CreateSimpleCollectionParam.Builder` | `withDimension​(int dimension)` | Sets the collection vector dimension.
    `CreateSimpleCollectionParam.Builder` | `withMaxLength​(@NonNull java.lang.Integer maxLength)` | Sets the primaryFiled maxLength.
    `CreateSimpleCollectionParam.Builder` | `withMetricType​(@NonNull MetricType metricType)` | Sets the metricType of vectorField.
    `CreateSimpleCollectionParam.Builder` | `withPrimaryField​(@NonNull java.lang.String primaryField)` | Sets the primaryFiled name.
    `CreateSimpleCollectionParam.Builder` | `withPrimaryFieldType​(@NonNull io.milvus.grpc.DataType primaryFieldType)` | Sets the primaryFiled type.
    `CreateSimpleCollectionParam.Builder` | `withSyncLoad​(boolean syncLoad)` | Sets the SyncLoad when loadCollection
    `CreateSimpleCollectionParam.Builder` | `withVectorField​(@NonNull java.lang.String vectorField)` | Sets the vectorField name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### withCollectionName

          public CreateSimpleCollectionParam.Builder withCollectionName​(@NonNull
                                                                        @NonNull java.lang.String collectionName)

      Sets the collection name. Collection name cannot be empty or null.
      Parameters:
        `collectionName` - collection name
      Returns:
        `Builder`

    - #### withDimension

          public CreateSimpleCollectionParam.Builder withDimension​(int dimension)

      Sets the collection vector dimension. Dimension value must be greater than zero and less than 32768.
      Parameters:
        `dimension` - collection vector dimension
      Returns:
        `Builder`

    - #### withMetricType

          public CreateSimpleCollectionParam.Builder withMetricType​(@NonNull
                                                                    @NonNull MetricType metricType)

      Sets the metricType of vectorField. The distance metric used for the collection.
      Parameters:
        `metricType` - metricType of vectorField
      Returns:
        `Builder`

    - #### withDescription

          public CreateSimpleCollectionParam.Builder withDescription​(@NonNull
                                                                     @NonNull java.lang.String description)

      Sets the collection description. The description can be empty. The default is "".
      Parameters:
        `description` - description of the collection
      Returns:
        `Builder`

    - #### withPrimaryField

          public CreateSimpleCollectionParam.Builder withPrimaryField​(@NonNull
                                                                      @NonNull java.lang.String primaryField)

      Sets the primaryFiled name. The primaryField cannot be empty or null. The default is "id".
      Parameters:
        `primaryField` - primaryFiled name of the collection
      Returns:
        `Builder`

    - #### withVectorField

          public CreateSimpleCollectionParam.Builder withVectorField​(@NonNull
                                                                     @NonNull java.lang.String vectorField)

      Sets the vectorField name. The vectorField cannot be empty or null. The default is "vector".
      Parameters:
        `vectorField` - vectorField name of the collection
      Returns:
        `Builder`

    - #### withAutoId

          public CreateSimpleCollectionParam.Builder withAutoId​(boolean autoId)

      Sets the autoId. The vectorField cannot be null. The default is Boolean.False.
      Parameters:
        `autoId` - if open autoId
      Returns:
        `Builder`

    - #### withSyncLoad

          public CreateSimpleCollectionParam.Builder withSyncLoad​(boolean syncLoad)

      Sets the SyncLoad when loadCollection

    - #### withConsistencyLevel

          public CreateSimpleCollectionParam.Builder withConsistencyLevel​(@NonNull
                                                                          @NonNull ConsistencyLevelEnum consistencyLevel)

      Sets the consistency level. The default value is `ConsistencyLevelEnum.BOUNDED`.
      Parameters:
        `consistencyLevel` - consistency level
      Returns:
        `Builder`
      See Also:
        `ConsistencyLevelEnum`

    - #### withPrimaryFieldType

          public CreateSimpleCollectionParam.Builder withPrimaryFieldType​(@NonNull
                                                                          @NonNull io.milvus.grpc.DataType primaryFieldType)

      Sets the primaryFiled type. The primaryField type cannot be empty or null. The default is "DataType.Int64".
      Parameters:
        `primaryFieldType` - primaryFiled type of the collection
      Returns:
        `Builder`

    - #### withMaxLength

          public CreateSimpleCollectionParam.Builder withMaxLength​(@NonNull
                                                                   @NonNull java.lang.Integer maxLength)

      Sets the primaryFiled maxLength. If primaryFiled is specified as varchar, this parameter maxLength needs to be specified
      Parameters:
        `maxLength` - maxLength of the primary field
      Returns:
        `Builder`

    - #### build

          public CreateSimpleCollectionParam build()
                                            throws ParamException

      Verifies parameters and creates a new `CreateSimpleCollectionParam` instance.
      Returns:
        `CreateSimpleCollectionParam`
      Throws:
        `ParamException`