com.github.grignaak.collections.Forkable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cow-collections Show documentation
Show all versions of cow-collections Show documentation
Copy-on-write collections for easy, thread-safe, immutability
The newest version!
package com.github.grignaak.collections;
import com.github.grignaak.collections.impl.Beta;
/**
* An object that can efficiently fork itself into a copy; typically with structural sharing on large objects.
*
* This is similar to {@link Cloneable} but where implementers guarantee some efficiency.
*
* @since 0.9.16
*/
@Beta
public interface Forkable {
/**
* Create an independent copy of this object, where mutations on the returned instance do not affect this instance
* and vice versa.
*/
Forkable fork();
}