/** * Creates an immutable copy of a {@link MethodCall} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable MethodCall instance */ public static ImmutableMethodCall copyOf(MethodCall instance) { if (instance instanceof ImmutableMethodCall) { return (ImmutableMethodCall) instance; } return ImmutableMethodCall.builder() .from(instance) .build(); }
@Override public List<Element> visitMethodcall(CPP14Parser.MethodcallContext ctx) { String methodName = ctx.Identifier().getText(); ImmutableMethodCall.Builder methodBuilder = ImmutableMethodCall.builder().name(methodName); ParametersVisitor paramsVisitor = new ParametersVisitor(); if (ctx.expressionlist() != null) {