@Test void buildsDescriptionWithType() { FunctionEntry.Builder builder = new FunctionEntry.Builder(); FunctionEntry entry = builder.build(); StringBuilder descBuilder = new StringBuilder(); entry.createDescription(descBuilder); assertThat(descBuilder.toString()).isEqualTo("{\"type\":\"function\"}"); }
@Override protected void createDescription(StringBuilder builder) { builder.append("{\"type\":\"function\""); if(proxiedFunction != null) { builder.append(",\"returns\":\"") .append(proxiedFunction.getReturnType().getName()) .append("\""); } builder.append("}"); }
FunctionEntry extends ApiEntry { @Override protected void createDescription(StringBuilder builder) { builder.append("{\"type\":\"function\""); if(proxiedFunction != null) { builder.append(",\"returns\":\"") .append(proxiedFunction.getReturnType().getName()) .append("\""); } builder.append("}"); } }
FunctionEntry extends ApiEntry { @Override protected void createDescription(StringBuilder builder) { builder.append("{\"type\":\"function\""); if(proxiedFunction != null) { builder.append(",\"returns\":\"") .append(proxiedFunction.getReturnType().getName()) .append("\""); } builder.append("}"); } private  FunctionEntry(); }
FunctionEntry extends ApiEntry { @Override protected void createDescription(StringBuilder builder) { builder.append("{\"type\":\"function\""); if(proxiedFunction != null) { builder.append(",\"returns\":\"") .append(proxiedFunction.getReturnType().getName()) .append("\""); } builder.append("}"); } private  FunctionEntry(); Object call(Object self, Object[] args); Method getProxiedFunction(); }
FunctionEntry extends ApiEntry { @Override protected void createDescription(StringBuilder builder) { builder.append("{\"type\":\"function\""); if(proxiedFunction != null) { builder.append(",\"returns\":\"") .append(proxiedFunction.getReturnType().getName()) .append("\""); } builder.append("}"); } private  FunctionEntry(); Object call(Object self, Object[] args); Method getProxiedFunction();  }