Skip to content

ArSiu/javaLabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java lab3

[1]Task make rest spring for lab2:

  • spring,
  • maven,
  • FindBugs,
  • CheckStyle,
  • PDM,
  • Jacoco.

[2]hOw tO Run spring

$ git clone https://github.com/ArSiu/javaLabs.git
$ cd javaLabs
$ git checkout lab2
$ mvn compile
$ mvn install
$ java -jar target/Lab9v1-1.0-SNAPSHOT.jar

[2]hOw tO Run site

$ git clone https://github.com/ArSiu/javaLabs.git
$ cd javaLabs
$ git checkout lab2
$ mvn compile
$ mvn site
$ cd target/site
$ run checkstyle.html

[3]All realization of methods in class TechniqueManager package manager

[3.1]addTechnique

public void addTechnique(final Technique technique) {
        tech.add(technique);
    }

[3.2]sortByName

public List<Technique> sortByName(final boolean reverse) {
        if (reverse) {
            tech.sort((Technique t1, Technique t2) ->
                    t2.getName().compareTo(t1.getName()));
        } else {
            tech.sort((Technique t1, Technique t2) ->
                    t1.getName().compareTo(t2.getName()));
        }
        return tech;
    }

[3.3]sortByPrice

public List<Technique> sortByPrice(final boolean reverse) {
        if (reverse) {
            tech.sort((Technique t1, Technique t2) ->
                    Float.compare(t2.getPrice(), t1.getPrice()));
        } else {
            tech.sort((Technique t1, Technique t2) ->
                    Float.compare(t1.getPrice(), t2.getPrice()));
        }
        return tech;
    }

[3.4]searchBar

public Optional<Technique> searchBar(final String search) {
        return tech.stream().filter(t ->
                t.getName().equals(search)).findAny();
    }

[3.5]show

public void show(final boolean reverse, final List<Technique> techniques) {
        techniques.forEach(System.out::println);
    }

[4]Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages