CountedCloner class base
Extended with enforced recursion and size limits BaseCloner.
The lightest way to prevent StackOverflow for circular references.
Counters are not reset between clone operations unless resetCounters is called.
- Inheritance
-
- Object
- BaseCloner
- CountedCloner
- Implemented types
Properties
- doTypedClone → bool
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- nestLimit → int
-
Maximum allowed nesting depth for recursive cloning.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sizeLimit → int
-
Maximum number of values allowed to be cloned.
final
Methods
-
cloneList<
E> (List< E> source) → List<E> -
Return a deep-cloned
List.override -
cloneMap<
K, V> (Map< K, V> source) → Map<K, dynamic> -
Return an untyped
Map<K, dynamic>with values deep-cloned.override -
cloneMapTyped<
K, V> (Map< K, V> source) → Map<K, V> -
Return a typed
Map<K, V>with values deep-cloned.override -
cloneSet<
E> (Set< E> source) → Set<E> -
Return a deep-cloned
Set.override -
cloneValue(
dynamic source) → dynamic -
Wrapper for BaseCloner.cloneValue implementation
with enforced size and nesting limits.
Throws LimitExceededException if limits are exceeded.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
Resets internal counters for size and nesting limits.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- NEST_LIMIT_DEFAULT → const int
- Default nesting depth limit (inclusive).
- SIZE_LIMIT_DEFAULT → const int
- Default size limit for cloned values (1024^2, inclusive).