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.

Extra 11. Java 8+

  1. Pārskatiet prezentāciju Java 8

Uzdevumi

  1. Pārliecinieties, ka izmantojat Eclipse 4.x.
  2. Pārskatiet pakotni jtm.extra11 un klasi RandomPerson pakotnē jtm.activity03.
  3. Pievienojiet jaunas metodes PersonMatcher saskarnei:
    1. metode Stream<RandomPerson> getPersonStream()
    2. 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.

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

  5. Pārbaudiet, vai jtm.extra11 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-05-06 20:27
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License