/** * Creates a {@link ClassRef} for the current definition with the specified arguments. * * @param arguments The arguments to be passed to the reference. */ public ClassRef toReference(List<TypeRef> arguments) { List<TypeRef> actualArguments = new ArrayList<TypeRef>(); for (int i = 0; i < parameters.size(); i++) { if (i < arguments.size()) { actualArguments.add(arguments.get(i)); } else { actualArguments.add(new WildcardRef()); } } return new ClassRefBuilder() .withDefinition(this) .withArguments(actualArguments) .withAttributes(getAttributes()) .build(); }
/** * Creates a {@link ClassRef} for the current definition with the specified arguments. * * @param arguments The arguments to be passed to the reference. */ public ClassRef toReference(TypeRef... arguments) { List<TypeRef> actualArguments = new ArrayList<TypeRef>(); for (int i = 0; i < parameters.size(); i++) { if (i < arguments.length) { actualArguments.add(arguments[i]); } else { actualArguments.add(new WildcardRef()); } } return new ClassRefBuilder() .withDefinition(this) .withArguments(actualArguments) .withAttributes(getAttributes()) .build(); }
/** * Creates a {@link ClassRef} for internal use inside the scope of the type (methods, properties * etc). It uses as arguments the same 'letters' as the parameters definition. */ public ClassRef toInternalReference() { List<TypeRef> arguments = new ArrayList<TypeRef>(); for (TypeParamDef parameter : parameters) { arguments.add(parameter.toReference()); } return new ClassRefBuilder() .withDefinition(this) .withArguments(arguments) .withAttributes(getAttributes()) .build(); }
public ClassRefBuilder(ClassRef instance, Boolean validationEnabled) { this.fluent = this; this.withDefinition(instance.getDefinition()); this.withFullyQualifiedName(instance.getFullyQualifiedName()); this.withDimensions(instance.getDimensions()); this.withArguments(instance.getArguments()); this.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; }