Package org.eolang.maven.tojos
Class PlacedTojos
- java.lang.Object
-
- org.eolang.maven.tojos.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 Summary
Constructors Constructor Description PlacedTojos(Path file)
Ctor.PlacedTojos(org.cactoos.scalar.Sticky<? extends com.yegor256.tojos.Tojos> tojos)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<PlacedTojo>
allBinaries()
Get all binaries.Collection<PlacedTojo>
classes()
Get all classes.void
close()
Optional<PlacedTojo>
find(Path target)
Find placed tojo by path.Optional<PlacedTojo>
findJar(String dep)
Find jar by dependency identifier.boolean
isEmpty()
Check whether tojos is empty.Collection<PlacedTojo>
jars()
Get all jars.PlacedTojo
placeClass(Path target, String related, String dep)
Place class into placed tojos file.void
placeJar(String name)
Place jar into placed tojos file.void
unplaceAll()
Unplace all tojos.
-
-
-
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
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
classes
public Collection<PlacedTojo> classes()
Get all classes.- Returns:
- All classes.
-
jars
public Collection<PlacedTojo> jars()
Get all jars.- Returns:
- All jars.
-
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.
-
-