If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

20. Java 8+

  1. Pārskatiet prezentāciju Java 8+

Uzdevumi

  1. Pārliecinieties, ka izmantojat Eclipse 4.x.
  2. Pārskatiet pakotni jtm.activity20 un klasi RandomPerson pakotnē jtm.activity03.
  3. Pievienojiet jaunas metodes PersonMatcher saskarnei:
    20. metode Stream<RandomPerson> getPersonStream()
    20.

    default method Stream<RandomPerson> getMatchedPersonStream() ar parameteriem:

    • Stream<RandomPerson> persons,
    • boolean isFemale,
    • int ageFrom,
    • int ageTo,
    • float weightFrom,
    • float weightTo

    Šai metodei ir jāatdod Stream ar nodotajiem persons, kas filtrētas atbilstoši nodoto dzimumu, vecuma diapazonam un svara diapazonam (tostarp). Padoms: varat izmantot straumes filtra modeli.

    20. static method List<RandomPerson> getPersonList(Stream<RandomPerson> persons)
    20. static method PersonMatcher getPersonManager()
    20. Implementējiet noklusēto un statisko metodi PersonMatcher saskarnē.
  4. Izveidojiet klasi PersonMatcherImpl kas implementē PersonMatcher saskarni un implementējiet tās metodes:
    20. public constructor PersonMatcherImpl()
    20. public void addPerson(RandomPerson person)
    20. public List<RandomPerson> getPersonList()
    20.

    public Stream<RandomPerson> getPersonStream()
    Padoms: varat izmantot Stream.Builder.

  5. Pārbaudiet, vai jtm.activity20 pakotnes vienības testi ir sekmīgi.
  6. Pārbaudiet, vai iziet citu pakotņu vienību testi. (Tie var neiziet, ja kādā implementācijā bija izmantota novecojusi Java 7 API).

  

Created by Valdis Vītoliņš on 2024-05-06 20:26
Last modified by Valdis Vītoliņš on 2024-12-04 14:45
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License