Move custom set to abstraction package
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0da4c57409
commit
aef1acf43e
|
@ -1,5 +1,8 @@
|
||||||
package abstraction;
|
package abstraction;
|
||||||
|
|
||||||
|
import datastructures.set.CustomSet;
|
||||||
|
import datastructures.set.CustomStrictSet;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package category;
|
package category;
|
||||||
|
|
||||||
import abstraction.CustomSet;
|
import datastructures.set.CustomSet;
|
||||||
import abstraction.CustomSetPersistenceDecorator;
|
import abstraction.CustomSetPersistenceDecorator;
|
||||||
import abstraction.PersistenceAdapter;
|
import abstraction.PersistenceAdapter;
|
||||||
import exeptions.CategoryAlreadyExists;
|
import exeptions.CategoryAlreadyExists;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package link;
|
package link;
|
||||||
|
|
||||||
import abstraction.CustomSet;
|
import datastructures.set.CustomSet;
|
||||||
import abstraction.CustomSetPersistenceDecorator;
|
import abstraction.CustomSetPersistenceDecorator;
|
||||||
import abstraction.PersistenceAdapter;
|
import abstraction.PersistenceAdapter;
|
||||||
import exeptions.LinkAlreadyExists;
|
import exeptions.LinkAlreadyExists;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package tag;
|
package tag;
|
||||||
|
|
||||||
import abstraction.CustomSet;
|
import datastructures.set.CustomSet;
|
||||||
import abstraction.CustomSetPersistenceDecorator;
|
import abstraction.CustomSetPersistenceDecorator;
|
||||||
import abstraction.PersistenceAdapter;
|
import abstraction.PersistenceAdapter;
|
||||||
import exeptions.TagMatcherAlreadyExists;
|
import exeptions.TagMatcherAlreadyExists;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package abstraction;
|
package datastructures.set;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
|
@ -1,7 +1,4 @@
|
||||||
package abstraction;
|
package datastructures.set;
|
||||||
|
|
||||||
import exeptions.ElementAlreadyInSet;
|
|
||||||
import exeptions.ElementNotInSet;
|
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
|
@ -1,4 +1,4 @@
|
||||||
package exeptions;
|
package datastructures.set;
|
||||||
|
|
||||||
public class ElementAlreadyInSet extends RuntimeException {
|
public class ElementAlreadyInSet extends RuntimeException {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package exeptions;
|
package datastructures.set;
|
||||||
|
|
||||||
public class ElementNotInSet extends RuntimeException {
|
public class ElementNotInSet extends RuntimeException {
|
||||||
|
|
|
@ -345,6 +345,14 @@ kann/hier nicht sinnvoll ist]
|
||||||
/[jeweils 1 Code-Beispiel zu 2 Code Smells aus der Vorlesung; jeweils
|
/[jeweils 1 Code-Beispiel zu 2 Code Smells aus der Vorlesung; jeweils
|
||||||
Code-Beispiel und einen möglichen Lösungsweg bzw. den genommen
|
Code-Beispiel und einen möglichen Lösungsweg bzw. den genommen
|
||||||
Lösungsweg beschreiben (inkl./ /(Pseudo-)Code)]/
|
Lösungsweg beschreiben (inkl./ /(Pseudo-)Code)]/
|
||||||
|
**** Duplicated Code
|
||||||
|
Da es bei Java keine Funktion zum durchsuchen eines Sets gibt wurde an mehreren Stellen ein Konstrukt, wie unten sichtbar
|
||||||
|
verwendert.
|
||||||
|
#+begin_src java
|
||||||
|
public Optional<Category> getByName(CategoryName name) {
|
||||||
|
return categories.stream().filter(category -> category.getName().equals(name)).findFirst();
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** 2 Refactorings
|
*** 2 Refactorings
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|
Reference in a new issue