# IndexParam.MetricType
Date: 2024-08-08

io.milvus.v2.common

## Enum IndexParam.MetricType

- java.lang.Object
- - java.lang.Enum<IndexParam.MetricType>
  - - io.milvus.v2.common.IndexParam.MetricType

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable<IndexParam.MetricType>

Enclosing class:
  IndexParam

    public static enum IndexParam.MetricType
    extends java.lang.Enum<IndexParam.MetricType>

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`COSINE`
`HAMMING`
`INVALID`
`IP`
`JACCARD`
`L2`

### Method Summary

All Methods Static Methods Concrete Methods
`static IndexParam.MetricType` `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
`static IndexParam.MetricType[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### INVALID

    public static final IndexParam.MetricType INVALID

#### L2

    public static final IndexParam.MetricType L2

#### IP

    public static final IndexParam.MetricType IP

#### COSINE

    public static final IndexParam.MetricType COSINE

#### HAMMING

    public static final IndexParam.MetricType HAMMING

#### JACCARD

    public static final IndexParam.MetricType JACCARD

### Method Detail

#### values

    public static IndexParam.MetricType[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (IndexParam.MetricType c : IndexParam.MetricType.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static IndexParam.MetricType valueOf(java.lang.String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
  `java.lang.NullPointerException` - if the argument is null