FunctionDesc implements ProtoObject<FunctionDescProto>, Cloneable, GsonObject, Comparable<FunctionDesc> { public FunctionSignature getSignature() { return signature; } FunctionDesc();  FunctionDesc(String signature, Class<? extends Function> clazz,
      FunctionType funcType, DataType retType, @NotNull DataType [] params);  FunctionDesc(FunctionDescProto proto);  FunctionDesc(String signature, String className, FunctionType type,
                      DataType retType,
                      @NotNull DataType... argTypes);  FunctionDesc(FunctionSignature signature, FunctionInvocation invocation, FunctionSupplement supplement); FunctionSignature getSignature(); FunctionInvocation getInvocation(); FunctionSupplement getSupplement(); Function newInstance(); FunctionType getFuncType(); String getFunctionName(); DataType [] getParamTypes(); DataType getReturnType(); @SuppressWarnings("unchecked") Class<? extends Function> getLegacyFuncClass(); String getDescription(); String getDetail(); String getExample(); void setDescription(String description); void setDetail(String detail); void setExample(String example); @Override int hashCode(); @Override boolean equals(Object obj); @Override Object clone(); @Override FunctionDescProto getProto(); @Override String toString(); String toJson(); String getHelpSignature(); @Override int compareTo(FunctionDesc o);  }
@Test public void testGetSignature() throws IOException, ClassNotFoundException { FunctionDesc desc = new FunctionDesc("sum", TestSum.class, FunctionType.GENERAL, CatalogUtil.newSimpleDataType(Type.INT4), CatalogUtil.newSimpleDataTypeArray(Type.INT4, Type.INT8)); desc.setDescription("desc"); desc.setExample("example"); desc.setDetail("detail"); assertEquals("sum", desc.getFunctionName()); assertEquals(TestSum.class, desc.getLegacyFuncClass()); assertEquals(FunctionType.GENERAL, desc.getFuncType()); assertEquals(Type.INT4, desc.getReturnType().getType()); assertArrayEquals(CatalogUtil.newSimpleDataTypeArray(Type.INT4, Type.INT8), desc.getParamTypes()); CommonTestingUtil.getTestDir(TEST_PATH); File save = new File(TEST_PATH + "/save.dat"); FileUtil.writeProto(save, desc.getProto()); FunctionDescProto proto = FunctionDescProto.getDefaultInstance(); proto = (FunctionDescProto) FileUtil.loadProto(save, proto); FunctionDesc newDesc = new FunctionDesc(proto); assertEquals("sum", newDesc.getFunctionName()); assertEquals(TestSum.class, newDesc.getLegacyFuncClass()); assertEquals(FunctionType.GENERAL, newDesc.getFuncType()); assertEquals(Type.INT4, newDesc.getReturnType().getType()); assertArrayEquals(CatalogUtil.newSimpleDataTypeArray(Type.INT4, Type.INT8), newDesc.getParamTypes()); assertEquals(desc.getProto(), newDesc.getProto()); }