/** * Sets the declared methods for this builder; equivalent to calling * {@link #addMethod(MethodMetadataBuilder)} once for each item of the given * {@link Iterable}. * * @param declaredMethods the methods to set; can be <code>null</code> for * none, otherwise the {@link Iterable} is defensively copied */ public final void setDeclaredMethods( final Iterable<? extends MethodMetadataBuilder> declaredMethods) { this.declaredMethods.clear(); if (declaredMethods != null) { for (final MethodMetadataBuilder methodBuilder : declaredMethods) { addMethod(methodBuilder); } } }
/** * Adds the given method to this builder * * @param method the method to add; can be <code>null</code> * @return <code>true</code> if the state of this builder changed */ public final boolean addMethod(final MethodMetadata method) { if (method == null) { return false; } return addMethod(new MethodMetadataBuilder(method)); }
/** * Sets the declared methods for this builder; equivalent to calling * {@link #addMethod(MethodMetadataBuilder)} once for each item of the given * {@link Iterable}. * * @param declaredMethods the methods to set; can be <code>null</code> for * none, otherwise the {@link Iterable} is defensively copied */ public final void setDeclaredMethods( final Iterable<? extends MethodMetadataBuilder> declaredMethods) { this.declaredMethods.clear(); if (declaredMethods != null) { for (final MethodMetadataBuilder methodBuilder : declaredMethods) { addMethod(methodBuilder); } } }
/** * Adds the given method to this builder * * @param method the method to add; can be <code>null</code> * @return <code>true</code> if the state of this builder changed */ public final boolean addMethod(final MethodMetadata method) { if (method == null) { return false; } return addMethod(new MethodMetadataBuilder(method)); }
targetBuilder.addMethod(method);
targetBuilder.addMethod(method);