Class PlacedTojos

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class PlacedTojos
    extends Object
    implements Closeable
    PlacedTojos encapsulates tojos logic and keeps short information about all placed files.
    Since:
    0.30
    • Constructor Detail

      • PlacedTojos

        public PlacedTojos​(Path file)
        Ctor.
        Parameters:
        file - Path to the tojos file.
      • PlacedTojos

        public PlacedTojos​(org.cactoos.scalar.Sticky<? extends com.yegor256.tojos.Tojos> tojos)
        Ctor.
        Parameters:
        tojos - Tojos source.
    • Method Detail

      • allBinaries

        public List<PlacedTojo> allBinaries()
        Get all binaries.
        Returns:
        All binaries jars with classes.
      • findJar

        public Optional<PlacedTojo> findJar​(String dep)
        Find jar by dependency identifier.
        Parameters:
        dep - Dependency identifier.
        Returns:
        Placed jar.
      • find

        public Optional<PlacedTojo> find​(Path target)
        Find placed tojo by path.
        Parameters:
        target - Path.
        Returns:
        Placed tojo.
      • placeClass

        public PlacedTojo placeClass​(Path target,
                                     String related,
                                     String dep)
        Place class into placed tojos file.
        Parameters:
        target - Path to the class.
        related - Related.
        dep - Dependency.
        Returns:
        Placed class.
      • placeJar

        public void placeJar​(String name)
        Place jar into placed tojos file.
        Parameters:
        name - Name of the jar.
      • unplaceAll

        public void unplaceAll()
        Unplace all tojos.
      • isEmpty

        public boolean isEmpty()
        Check whether tojos is empty.
        Returns:
        True if empty.