I have the following class structure
public class Linha implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String prefixo;
private String nome;
private LocalDate dataInicio;
private LocalDate dataLimite;
private Status status;
private List<Itinerario> itinerarios;
//Demais get set e metodos
}
public class Itinerario implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Sentido sentido;
private List<PontoDoItinerario> pontosDoItinerario;
private List<Horario> hoariosDoItinerario;
private Linha linha;
//Demais get set e metodos
}
public class PontoDoItinerario implements Serializable,Comparable<PontoDoItinerario> {
private static final long serialVersionUID = 1L;
private Long id;
private Integer sequencia;
private PontoDeParada pontoDeParada;
private Itinerario itinerario;
private BigDecimal km;
private LocalTime tempoEstimado;
//Demais get set e metodos
}
public class PontoDeParada implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String prefixo;
private String nome;
private double latitude;
private double longitude;
private String referencia;
//Demais get set e metodos
}
I have a list of Lines:
- Containing a list of Itineraries
- Containing a list of Endpoint
- that contains a PointPart per item
I need to filter through the id of the Parameters.
How can I do this using the java 8 stream.filter?