Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type | Name and Description |
---|---|
String[] |
excludes Comma separated list of property (and/or field) names to exclude from cloning. |
boolean |
includeFields Include fields as well as properties when cloning. |
AutoCloneStyle |
style Style to use when cloning. |
Comma separated list of property (and/or field) names to exclude from cloning. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
NOTE: When using the CLONE
style, property (and/or field) copying might occur as part of
calling super.clone()
which will ignore this list. You can then use this list to
streamline the provided clone()
implementation by selecting which Cloneable properties
(and/or fields) will have a subsequent call to their clone()
method. If you have
immutable properties (and/or fields) this can be useful as the extra clone()
will
not be necessary and cloning will be more efficient.
NOTE: This doesn't affect property (and/or field) copying that might occur as part
of serialization when using the SERIALIZATION
style, i.e. this flag is ignored;
instead adjust your serialization code to include or exclude the desired
properties (and/or fields) which should carry over during cloning.
@default {}
Include fields as well as properties when cloning.
NOTE: When using the CLONE
style, field copying might occur as part of
calling super.clone()
and might be all you require; if you turn on
this flag, the provided clone()
implementation will also
subsequently call clone()
for each Cloneable
field which can be
useful if you have mutable fields.
NOTE: This doesn't affect field copying that might occur as part of
serialization when using the SERIALIZATION
style, i.e. this flag is ignored;
instead adjust your serialization code to include or exclude your fields.
@default false
Style to use when cloning. @default AutoCloneStyle.CLONE