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 Tojoadd(String name)Add new tojo with the given ID.TojogetById(String name)Get one tojo by ID.Collection<Tojo>select(org.cactoos.Func<Tojo,Boolean> filter)Select some tojos.intsize()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 IOExceptionGet size.- Returns:
- Total count
- Throws:
IOException- If fails
-
add
public Tojo add(String name) throws IOException
Description copied from interface:TojosAdd new tojo with the given ID. If another tojo already exists with this ID, it will be returned.- Specified by:
addin 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:TojosSelect some tojos.- Specified by:
selectin interfaceTojos- Parameters:
filter- The filter- Returns:
- Collection of them
- Throws:
IOException- If fails
-
-