Class SCMBuilder<B extends SCMBuilder<B,​S>,​S extends SCM>

  • Type Parameters:
    B - the type of SCMBuilder so that subclasses can chain correctly in their withHead(SCMHead) etc methods.
    S - the type of SCM returned by build()

    public abstract class SCMBuilder<B extends SCMBuilder<B,​S>,​S extends SCM>
    extends Object
    Builder for a SCM instance. Typically instantiated in, SCMRevision) or and then decorated by SCMSourceTrait.applyToBuilder(SCMBuilder) before calling build() to generate the return value. Conventions:
    • The builder is not designed to be shared by multiple threads.
    • All methods should be either final or abstract unless there is a documented reason for allowing overrides
    • All "setter" methods will return SCMBuilder and be called "withXxx"
    • All "getter" methods will be called "xxx()". Callers should not assume that the returned value is resistant from concurrent changes. Implementations should ensure that the returned value is immutable by the caller. In other words, it is intentional for implementations to reduce intermediate allocations by return Collections.unmodifiableList(theList); rather than the concurrency safe return Collections.unmodifiableList(new ArrayList<>(theList));