io.milvus.param

## Class ParamUtils

- java.lang.Object
- - io.milvus.param.ParamUtils

-     public class ParamUtils
      extends java.lang.Object

  Utility functions for param classes

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ParamUtils.InsertBuilderWrapper`
    `static class` | `ParamUtils.InsertDataInfo`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParamUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<io.milvus.grpc.KeyValuePair>` | `AssembleKvPair(java.util.Map<java.lang.String,java.lang.String> sourceMap)`
    `static void` | `checkFieldData(FieldType fieldSchema, InsertParam.Field fieldData)`
    `static void` | `checkFieldData(FieldType fieldSchema, java.util.List<?> values, boolean verifyElementType)`
    `static java.lang.Object` | `checkFieldValue(FieldType fieldSchema, com.google.gson.JsonElement value)`
    `static void` | `CheckNullEmptyString(java.lang.String target, java.lang.String name)` Checks if a string is empty or null.
    `static void` | `CheckNullString(java.lang.String target, java.lang.String name)` Checks if a string is null.
    `static io.milvus.grpc.SearchRequest` | `convertAnnSearchParam(@NonNull AnnSearchParam annSearchParam, ConsistencyLevelEnum consistencyLevel)`
    `static FieldType` | `ConvertField(@NonNull io.milvus.grpc.FieldSchema field)` Convert a grpc field schema to client field schema
    `static io.milvus.grpc.FieldSchema` | `ConvertField(@NonNull FieldType field)` Convert a client field schema to grpc field schema
    `static io.milvus.grpc.HybridSearchRequest` | `convertHybridSearchParam(@NonNull HybridSearchParam requestParam)`
    `static java.util.List<java.lang.Object>` | `convertJsonArray(com.google.gson.JsonArray jsonArray, io.milvus.grpc.DataType elementType, java.lang.String fieldName)`
    `static com.google.protobuf.ByteString` | `convertPlaceholder(java.util.List<?> vectors, io.milvus.grpc.PlaceholderType placeType)`
    `static io.milvus.grpc.QueryRequest` | `convertQueryParam(@NonNull QueryParam requestParam)`
    `static io.milvus.grpc.SearchRequest` | `convertSearchParam(@NonNull SearchParam requestParam)`
    `static java.util.SortedMap<java.lang.Long,java.lang.Float>` | `decodeSparseFloatVector(java.nio.ByteBuffer buf)`
    `static java.nio.ByteBuffer` | `encodeSparseFloatVector(java.util.SortedMap<java.lang.Long,java.lang.Float> sparse)`
    `static io.milvus.grpc.FieldData` | `genFieldData(FieldType fieldType, java.util.List<?> objects)`
    `static io.milvus.grpc.FieldData` | `genFieldData(FieldType fieldType, java.util.List<?> objects, boolean isDynamic)`
    `static boolean` | `isVectorDataType(io.milvus.grpc.DataType dataType)`

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

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

- - ### Constructor Detail

    - #### ParamUtils

          public ParamUtils()

  - ### Method Detail

    - #### checkFieldData

          public static void checkFieldData(FieldType fieldSchema,
                                            InsertParam.Field fieldData)

    - #### checkFieldData

          public static void checkFieldData(FieldType fieldSchema,
                                            java.util.List<?> values,
                                            boolean verifyElementType)

    - #### checkFieldValue

          public static java.lang.Object checkFieldValue(FieldType fieldSchema,
                                                         com.google.gson.JsonElement value)

    - #### convertJsonArray

          public static java.util.List<java.lang.Object> convertJsonArray(com.google.gson.JsonArray jsonArray,
                                                                          io.milvus.grpc.DataType elementType,
                                                                          java.lang.String fieldName)

    - #### CheckNullEmptyString

          public static void CheckNullEmptyString(java.lang.String target,
                                                  java.lang.String name)
                                           throws ParamException

      Checks if a string is empty or null. Throws `ParamException` if the string is empty of null.
      Parameters:
        `target` - target string
        `name` - a name to describe this string
      Throws:
        `ParamException`

    - #### CheckNullString

          public static void CheckNullString(java.lang.String target,
                                             java.lang.String name)
                                      throws ParamException

      Checks if a string is null. Throws `ParamException` if the string is null.
      Parameters:
        `target` - target string
        `name` - a name to describe this string
      Throws:
        `ParamException`

    - #### convertPlaceholder

          public static com.google.protobuf.ByteString convertPlaceholder(java.util.List<?> vectors,
                                                                          io.milvus.grpc.PlaceholderType placeType)
                                                                   throws ParamException

      Throws:
        `ParamException`

    - #### convertSearchParam

          public static io.milvus.grpc.SearchRequest convertSearchParam(@NonNull
                                                                        @NonNull SearchParam requestParam)
                                                                 throws ParamException

      Throws:
        `ParamException`

    - #### convertAnnSearchParam

          public static io.milvus.grpc.SearchRequest convertAnnSearchParam(@NonNull
                                                                           @NonNull AnnSearchParam annSearchParam,
                                                                           ConsistencyLevelEnum consistencyLevel)

    - #### convertHybridSearchParam

          public static io.milvus.grpc.HybridSearchRequest convertHybridSearchParam(@NonNull
                                                                                    @NonNull HybridSearchParam requestParam)
                                                                             throws ParamException

      Throws:
        `ParamException`

    - #### convertQueryParam

          public static io.milvus.grpc.QueryRequest convertQueryParam(@NonNull
                                                                      @NonNull QueryParam requestParam)

    - #### isVectorDataType

          public static boolean isVectorDataType(io.milvus.grpc.DataType dataType)

    - #### genFieldData

          public static io.milvus.grpc.FieldData genFieldData(FieldType fieldType,
                                                              java.util.List<?> objects)

    - #### genFieldData

          public static io.milvus.grpc.FieldData genFieldData(FieldType fieldType,
                                                              java.util.List<?> objects,
                                                              boolean isDynamic)

    - #### encodeSparseFloatVector

          public static java.nio.ByteBuffer encodeSparseFloatVector(java.util.SortedMap<java.lang.Long,java.lang.Float> sparse)

    - #### decodeSparseFloatVector

          public static java.util.SortedMap<java.lang.Long,java.lang.Float> decodeSparseFloatVector(java.nio.ByteBuffer buf)

    - #### ConvertField

          public static FieldType ConvertField(@NonNull
                                               @NonNull io.milvus.grpc.FieldSchema field)

      Convert a grpc field schema to client field schema
      Parameters:
        `field` - FieldSchema object
      Returns:
        `FieldType` schema of the field

    - #### ConvertField

          public static io.milvus.grpc.FieldSchema ConvertField(@NonNull
                                                                @NonNull FieldType field)

      Convert a client field schema to grpc field schema
      Parameters:
        `field` - `FieldType` object
      Returns:
        `FieldSchema` schema of the field

    - #### AssembleKvPair

          public static java.util.List<io.milvus.grpc.KeyValuePair> AssembleKvPair(java.util.Map<java.lang.String,java.lang.String> sourceMap)