Package org.eolang.tojos
Class SmartTojos
- java.lang.Object
-
- org.eolang.tojos.SmartTojos
-
-
Constructor Summary
Constructors Constructor Description SmartTojos(Tojos tojos)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tojo
add(String name)
Add new tojo with the given ID.Tojo
getById(String name)
Get one tojo by ID.Collection<Tojo>
select(org.cactoos.Func<Tojo,Boolean> filter)
Select some tojos.int
size()
Get size.
-
-
-
Constructor Detail
-
SmartTojos
public SmartTojos(Tojos tojos)
Ctor.- Parameters:
tojos
- The origin
-
-
Method Detail
-
getById
public Tojo getById(String name) throws IOException
Get one tojo by ID.- Parameters:
name
- The id- Returns:
- The tojo if found
- Throws:
IOException
- If fails
-
size
public int size() throws IOException
Get size.- Returns:
- Total count
- Throws:
IOException
- If fails
-
add
public Tojo add(String name) throws IOException
Description copied from interface:Tojos
Add new tojo with the given ID. If another tojo already exists with this ID, it will be returned.- Specified by:
add
in interfaceTojos
- Parameters:
name
- The ID of the tojo- Returns:
- The tojo created or found
- Throws:
IOException
- If fails
-
select
public Collection<Tojo> select(org.cactoos.Func<Tojo,Boolean> filter) throws IOException
Description copied from interface:Tojos
Select some tojos.- Specified by:
select
in interfaceTojos
- Parameters:
filter
- The filter- Returns:
- Collection of them
- Throws:
IOException
- If fails
-
-