FunctionDesc implements ProtoObject<FunctionDescProto>, Cloneable, GsonObject, Comparable<FunctionDesc> { @Override public FunctionDescProto getProto() { if (builder == null) { builder = FunctionDescProto.newBuilder(); } else { builder.clear(); } builder.setSignature(signature.getProto()); builder.setSupplement(supplement.getProto()); builder.setInvocation(invocation.getProto()); return builder.build(); } 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 testGetProto() throws InternalException, ClassNotFoundException { FunctionDesc desc = new FunctionDesc("sum", TestSum.class, FunctionType.GENERAL, CatalogUtil.newSimpleDataType(Type.INT4), CatalogUtil.newSimpleDataTypeArray(Type.INT4, Type.INT8)); FunctionDescProto proto = desc.getProto(); FunctionDesc fromProto = new FunctionDesc(proto); assertEquals(desc, fromProto); assertEquals(desc.toJson(), fromProto.toJson()); }