@Test public void testDescribe() { assertEquals("(int, java.lang.Object) -> java.lang.String", invokableA.describe()); assertEquals("(boolean) -> void", invokableB.describe()); assertEquals("() -> type variable A", invokableC.describe()); assertEquals("() -> java.lang.String", invokableD.describe()); }
@Override public String describe() { return "(" + String.join(", " , internalInvokableDefinition.getFormalParameters().stream().map((fp)->fp.getType().describe()).collect(Collectors.toList())) + ") -> " + internalInvokableDefinition.getReturnType().describe(); }
InvokableReferenceTypeUsage implements TypeUsage, Invokable { @Override public String describe() { return "(" + String.join(", " , internalInvokableDefinition.getFormalParameters().stream().map((fp)->fp.getType().describe()).collect(Collectors.toList())) + ") -> " + internalInvokableDefinition.getReturnType().describe(); } }
InvokableReferenceTypeUsage implements TypeUsage, Invokable { @Override public String describe() { return "(" + String.join(", " , internalInvokableDefinition.getFormalParameters().stream().map((fp)->fp.getType().describe()).collect(Collectors.toList())) + ") -> " + internalInvokableDefinition.getReturnType().describe(); } InvokableReferenceTypeUsage(InternalInvokableDefinition internalInvokableDefinition); }
InvokableReferenceTypeUsage implements TypeUsage, Invokable { @Override public String describe() { return "(" + String.join(", " , internalInvokableDefinition.getFormalParameters().stream().map((fp)->fp.getType().describe()).collect(Collectors.toList())) + ") -> " + internalInvokableDefinition.getReturnType().describe(); } InvokableReferenceTypeUsage(InternalInvokableDefinition internalInvokableDefinition); @Override TypeUsage replaceTypeVariables(Map<String, T> typeParams); @Override boolean sameType(TypeUsage other); @Override boolean isInvokable(); @Override Invokable asInvokable(); @Override JvmType jvmType(); @Override boolean hasInstanceField(String fieldName, Symbol instance); @Override Symbol getInstanceField(String fieldName, Symbol instance); @Override Optional<Invokable> getMethod(String method, boolean staticContext); @Override boolean canBeAssignedTo(TypeUsage type); @Override boolean isOverloaded(); @Override Optional<InternalInvokableDefinition> internalInvokableDefinitionFor(List<ActualParam> actualParams); @Override String describe(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
InvokableReferenceTypeUsage implements TypeUsage, Invokable { @Override public String describe() { return "(" + String.join(", " , internalInvokableDefinition.getFormalParameters().stream().map((fp)->fp.getType().describe()).collect(Collectors.toList())) + ") -> " + internalInvokableDefinition.getReturnType().describe(); } InvokableReferenceTypeUsage(InternalInvokableDefinition internalInvokableDefinition); @Override TypeUsage replaceTypeVariables(Map<String, T> typeParams); @Override boolean sameType(TypeUsage other); @Override boolean isInvokable(); @Override Invokable asInvokable(); @Override JvmType jvmType(); @Override boolean hasInstanceField(String fieldName, Symbol instance); @Override Symbol getInstanceField(String fieldName, Symbol instance); @Override Optional<Invokable> getMethod(String method, boolean staticContext); @Override boolean canBeAssignedTo(TypeUsage type); @Override boolean isOverloaded(); @Override Optional<InternalInvokableDefinition> internalInvokableDefinitionFor(List<ActualParam> actualParams); @Override String describe(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }