-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Performance #287] Introduce base class for Vocabulary related event
- Loading branch information
Showing
12 changed files
with
77 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/cz/cvut/kbss/termit/event/VocabularyEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cz.cvut.kbss.termit.event; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.springframework.context.ApplicationEvent; | ||
|
||
import java.net.URI; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Base class for vocabulary related events | ||
*/ | ||
public abstract class VocabularyEvent extends ApplicationEvent { | ||
protected final URI vocabularyIri; | ||
|
||
protected VocabularyEvent(Object source, @NotNull URI vocabularyIri) { | ||
super(source); | ||
Objects.requireNonNull(vocabularyIri); | ||
this.vocabularyIri = vocabularyIri; | ||
} | ||
|
||
/** | ||
* The identifier of the vocabulary to which this event is bound | ||
* @return vocabulary IRI | ||
*/ | ||
public URI getVocabularyIri() { | ||
return vocabularyIri; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 4 additions & 10 deletions
14
src/main/java/cz/cvut/kbss/termit/event/VocabularyWillBeRemovedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
package cz.cvut.kbss.termit.event; | ||
|
||
import org.springframework.context.ApplicationEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.net.URI; | ||
|
||
/** | ||
* Indicates that a Vocabulary will be removed | ||
*/ | ||
public class VocabularyWillBeRemovedEvent extends ApplicationEvent { | ||
private final URI vocabulary; | ||
public class VocabularyWillBeRemovedEvent extends VocabularyEvent { | ||
|
||
public VocabularyWillBeRemovedEvent(Object source, URI vocabulary) { | ||
super(source); | ||
this.vocabulary = vocabulary; | ||
} | ||
|
||
public URI getVocabulary() { | ||
return vocabulary; | ||
public VocabularyWillBeRemovedEvent(Object source, @NotNull URI vocabularyIri) { | ||
super(source, vocabularyIri); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters