Class ParamUtils


  • public class ParamUtils
    extends java.lang.Object
    Utility functions for param classes
    • Constructor Summary

      Constructors 
      Constructor Description
      ParamUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<io.milvus.grpc.KeyValuePair> AssembleKvPair​(java.util.Map<java.lang.String,​java.lang.String> sourceMap)  
      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 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.QueryRequest convertQueryParam​(@NonNull QueryParam requestParam)  
      static io.milvus.grpc.SearchRequest convertSearchParam​(@NonNull SearchParam requestParam)  
      static java.util.HashMap<io.milvus.grpc.DataType,​java.lang.String> getTypeErrorMsg()  
      static boolean IsBinaryMetric​(MetricType metric)
      Checks if a metric is for binary vector.
      static boolean IsFloatMetric​(MetricType metric)
      Checks if a metric is for float vector.
      static boolean IsVectorIndex​(IndexType idx)
      Checks if an index type is for vector field.
      static boolean VerifyIndexType​(IndexType indexType, io.milvus.grpc.DataType dataType)
      Checks if an index type is matched with data type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParamUtils

        public ParamUtils()
    • Method Detail

      • getTypeErrorMsg

        public static java.util.HashMap<io.milvus.grpc.DataType,​java.lang.String> getTypeErrorMsg()
      • 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
      • IsFloatMetric

        public static boolean IsFloatMetric​(MetricType metric)
        Checks if a metric is for float vector.
        Parameters:
        metric - metric type
      • IsBinaryMetric

        public static boolean IsBinaryMetric​(MetricType metric)
        Checks if a metric is for binary vector.
        Parameters:
        metric - metric type
      • IsVectorIndex

        public static boolean IsVectorIndex​(IndexType idx)
        Checks if an index type is for vector field.
        Parameters:
        idx - index type
      • VerifyIndexType

        public static boolean VerifyIndexType​(IndexType indexType,
                                              io.milvus.grpc.DataType dataType)
        Checks if an index type is matched with data type.
        Parameters:
        indexType - index type
        dataType - data type
      • convertQueryParam

        public static io.milvus.grpc.QueryRequest convertQueryParam​(@NonNull
                                                                    @NonNull QueryParam requestParam)
      • 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)