Class KeepPathEntry

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<KeepPathEntry>

    public class KeepPathEntry
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<KeepPathEntry>
    One protected path in a keep-paths manifest: a source-set directory paired with a file's path relative to it. Serialized by the native executor as <sourceSetDir>\t<relPath>, bit-compatible with the prune-stale (#357) and digest-check --keep-paths-from consumers.
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.build.assembly.KeepPathEntry type.
      • SOURCE_SET_DIR

        public static final Name SOURCE_SET_DIR
        Name of the hydra.build.assembly.KeepPathEntry.sourceSetDir field.
      • REL_PATH

        public static final Name REL_PATH
        Name of the hydra.build.assembly.KeepPathEntry.relPath field.
      • sourceSetDir

        public final java.lang.String sourceSetDir
        The source-set directory the file belongs to, as a worktree-relative path
      • relPath

        public final java.lang.String relPath
        The file's path relative to its source-set directory
    • Constructor Detail

      • KeepPathEntry

        public KeepPathEntry​(java.lang.String sourceSetDir,
                             java.lang.String relPath)
        Constructs an immutable KeepPathEntry.
        Parameters:
        sourceSetDir - The source-set directory the file belongs to, as a worktree-relative path
        relPath - The file's path relative to its source-set directory
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(KeepPathEntry other)
        Specified by:
        compareTo in interface java.lang.Comparable<KeepPathEntry>
      • withSourceSetDir

        public KeepPathEntry withSourceSetDir​(java.lang.String sourceSetDir)
        Returns a copy of this KeepPathEntry with sourceSetDir replaced.
      • withRelPath

        public KeepPathEntry withRelPath​(java.lang.String relPath)
        Returns a copy of this KeepPathEntry with relPath replaced.