Class ParamUtils


  • public class ParamUtils
    extends Object
    Utility functions for param classes
    • Constructor Detail

      • ParamUtils

        public ParamUtils()
    • Method Detail

      • CheckNullEmptyString

        public static void CheckNullEmptyString​(String target,
                                                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​(String target,
                                           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,
                                              DataType dataType)
        Checks if an index type is matched with data type.
        Parameters:
        indexType - index type
        dataType - data type
      • convertQueryParam

        public static QueryRequest convertQueryParam​(@NonNull
                                                     @NonNull QueryParam requestParam)
      • ConvertField

        public static FieldType ConvertField​(@NonNull
                                             @NonNull FieldSchema field)
        Convert a grpc field schema to client field schema
        Parameters:
        field - FieldSchema object
        Returns:
        FieldType schema of the field
      • ConvertField

        public static 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