Package io.milvus.response
Class FieldDataWrapper
- java.lang.Object
-
- io.milvus.response.FieldDataWrapper
-
public class FieldDataWrapper extends Object
Utility class to wrap response ofquery/searchinterface.
-
-
Constructor Summary
Constructors Constructor Description FieldDataWrapper(@NonNull FieldData fieldData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(int index, String paramName)BooleangetAsBool(int index, String paramName)DoublegetAsDouble(int index, String paramName)IntegergetAsInt(int index, String paramName)StringgetAsString(int index, String paramName)intgetDim()Gets the dimension value of a vector field.List<?>getFieldData()Returns the field data according to its type: FloatVector field returns List of List Float, BinaryVector/Float16Vector/BFloat16Vector fields return List of ByteBuffer SparseFloatVector field returns List of SortedMap[Long, Float] Int64 field returns List of Long Int32/Int16/Int8 fields return List of Integer Bool field returns List of Boolean Float field returns List of Float Double field returns List of Double Varchar field returns List of String Array field returns List of List JSON field returns List of String; etc.longgetRowCount()Gets the row count of a field.booleanisDynamicField()booleanisJsonField()booleanisVectorField()static com.alibaba.fastjson.JSONObjectParseJSONObject(Object object)ObjectvalueByIdx(int index)
-
-
-
Constructor Detail
-
FieldDataWrapper
public FieldDataWrapper(@NonNull @NonNull FieldData fieldData)
-
-
Method Detail
-
isVectorField
public boolean isVectorField()
-
isJsonField
public boolean isJsonField()
-
isDynamicField
public boolean isDynamicField()
-
getDim
public int getDim() throws IllegalResponseExceptionGets the dimension value of a vector field. ThrowIllegalResponseExceptionif the field is not a vector filed.- Returns:
intdimension of the vector field- Throws:
IllegalResponseException
-
getRowCount
public long getRowCount() throws IllegalResponseExceptionGets the row count of a field. * ThrowsIllegalResponseExceptionif the field type is illegal.- Returns:
longrow count of the field- Throws:
IllegalResponseException
-
getFieldData
public List<?> getFieldData() throws IllegalResponseException
Returns the field data according to its type: FloatVector field returns List of List Float, BinaryVector/Float16Vector/BFloat16Vector fields return List of ByteBuffer SparseFloatVector field returns List of SortedMap[Long, Float] Int64 field returns List of Long Int32/Int16/Int8 fields return List of Integer Bool field returns List of Boolean Float field returns List of Float Double field returns List of Double Varchar field returns List of String Array field returns List of List JSON field returns List of String; etc. ThrowsIllegalResponseExceptionif the field type is illegal.- Returns:
List- Throws:
IllegalResponseException
-
getAsInt
public Integer getAsInt(int index, String paramName) throws IllegalResponseException
- Throws:
IllegalResponseException
-
getAsString
public String getAsString(int index, String paramName) throws IllegalResponseException
- Throws:
IllegalResponseException
-
getAsBool
public Boolean getAsBool(int index, String paramName) throws IllegalResponseException
- Throws:
IllegalResponseException
-
getAsDouble
public Double getAsDouble(int index, String paramName) throws IllegalResponseException
- Throws:
IllegalResponseException
-
get
public Object get(int index, String paramName) throws IllegalResponseException
- Throws:
IllegalResponseException
-
valueByIdx
public Object valueByIdx(int index) throws ParamException
- Throws:
ParamException
-
ParseJSONObject
public static com.alibaba.fastjson.JSONObject ParseJSONObject(Object object)
-
-