/** * Copy constructor. * * @param prototype the prototype */ private ConstructorImpl(final Constructor prototype) { javadoc = requireNonNull(prototype).getJavadoc().map(Copier::copy).orElse(null); imports = Copier.copy(prototype.getImports()); annotations = Copier.copy(prototype.getAnnotations()); generics = Copier.copy(prototype.getGenerics()); params = Copier.copy(prototype.getFields()); code = Copier.copy(prototype.getCode(), c -> c); modifiers = Copier.copy(prototype.getModifiers(), Modifier::copy, EnumSet.noneOf(Modifier.class)); exceptions = new LinkedHashSet<>(prototype.getExceptions()); }
/** * Copy constructor. * * @param prototype the prototype */ protected ConstructorImpl(final Constructor prototype) { javadoc = requireNonNull(prototype).getJavadoc().map(Copier::copy).orElse(null); annotations = Copier.copy(prototype.getAnnotations()); params = Copier.copy(prototype.getFields()); code = Copier.copy(prototype.getCode(), c -> c); modifiers = Copier.copy(prototype.getModifiers(), c -> c.copy(), EnumSet.noneOf(Modifier.class)); exceptions = new LinkedHashSet<>(prototype.getExceptions()); }
/** * Copy constructor. * * @param prototype the prototype */ private ConstructorImpl(final Constructor prototype) { javadoc = requireNonNull(prototype).getJavadoc().map(Copier::copy).orElse(null); imports = Copier.copy(prototype.getImports()); annotations = Copier.copy(prototype.getAnnotations()); generics = Copier.copy(prototype.getGenerics()); params = Copier.copy(prototype.getFields()); code = Copier.copy(prototype.getCode(), c -> c); modifiers = Copier.copy(prototype.getModifiers(), Modifier::copy, EnumSet.noneOf(Modifier.class)); exceptions = new LinkedHashSet<>(prototype.getExceptions()); }