Class ImmutableReferenceMetadata.Builder

  • Enclosing class:
    ImmutableReferenceMetadata

    @NotThreadSafe
    public static final class ImmutableReferenceMetadata.Builder
    extends Object
    Builds instances of type ImmutableReferenceMetadata. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableReferenceMetadata.Builder from​(ReferenceMetadata instance)
        Fill a builder with attribute values from the provided ReferenceMetadata instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • numCommitsAhead

        @CanIgnoreReturnValue
        public final ImmutableReferenceMetadata.Builder numCommitsAhead​(@Nullable
                                                                        Integer numCommitsAhead)
        Initializes the value for the numCommitsAhead attribute.
        Parameters:
        numCommitsAhead - The value for numCommitsAhead (can be null)
        Returns:
        this builder for use in a chained invocation
      • numCommitsBehind

        @CanIgnoreReturnValue
        public final ImmutableReferenceMetadata.Builder numCommitsBehind​(@Nullable
                                                                         Integer numCommitsBehind)
        Initializes the value for the numCommitsBehind attribute.
        Parameters:
        numCommitsBehind - The value for numCommitsBehind (can be null)
        Returns:
        this builder for use in a chained invocation
      • commonAncestorHash

        @CanIgnoreReturnValue
        public final ImmutableReferenceMetadata.Builder commonAncestorHash​(@Nullable
                                                                           String commonAncestorHash)
        Initializes the value for the commonAncestorHash attribute.
        Parameters:
        commonAncestorHash - The value for commonAncestorHash (can be null)
        Returns:
        this builder for use in a chained invocation
      • numTotalCommits

        @CanIgnoreReturnValue
        public final ImmutableReferenceMetadata.Builder numTotalCommits​(@Nullable
                                                                        Long numTotalCommits)
        Initializes the value for the numTotalCommits attribute.
        Parameters:
        numTotalCommits - The value for numTotalCommits (can be null)
        Returns:
        this builder for use in a chained invocation