-
-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve YAML model repository #4024
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d7c3ef6
Improve YAML model repository
J-N-K 2b3bc17
improvement
J-N-K dbb00d8
further work
J-N-K 2afeb82
improvement
J-N-K a8f6f1a
improvement
J-N-K 20e2cf3
better naming
J-N-K e259392
further work, add read/write lock
J-N-K c4df668
more tests
J-N-K 7004007
Revert "Auxiliary commit to revert individual files from d7c3ef6aab6d…
J-N-K e1365ce
address review comments
J-N-K a5730de
fix typos
J-N-K File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
65 changes: 0 additions & 65 deletions
65
...g.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/AbstractYamlFile.java
This file was deleted.
Oops, something went wrong.
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
...rg.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/YamlElementName.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 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.core.model.yaml; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
/** | ||
* The {@link YamlElementName} is a required annotation for the inheritors of {@link YamlElement}. It specifies the root | ||
* element name in a YAML model that is described by the respective class. Code review MUST ensure that element names | ||
* are unique. | ||
* | ||
* @author Jan N. Klug - Initial contribution | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface YamlElementName { | ||
String value(); | ||
} |
48 changes: 0 additions & 48 deletions
48
bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/YamlFile.java
This file was deleted.
Oops, something went wrong.
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
29 changes: 29 additions & 0 deletions
29
...penhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/YamlModelRepository.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,29 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.core.model.yaml; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link YamlModelRepository} defines methods to update elements in a YAML model. | ||
* | ||
* @author Jan N. Klug - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public interface YamlModelRepository { | ||
void addElementToModel(String modelName, YamlElement element); | ||
|
||
void removeElementFromModel(String modelName, YamlElement element); | ||
|
||
void updateElementInModel(String modelName, YamlElement element); | ||
} |
39 changes: 0 additions & 39 deletions
39
...openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/YamlParseException.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This essentially a DTO. Missing elements in the data are de-serialized as
null
.If we decide to make the DTO classes
@NonNullByDefault
we would need to either annotate all fields with@Nullable
(which is the similar to not annotating the class at all) or provide default values (which doesn't make sense in most cases).