Skip to content

Commit

Permalink
Correct null annotations on Thing class
Browse files Browse the repository at this point in the history
Fixes eclipse-archived#4099

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
  • Loading branch information
triller-telekom committed Nov 30, 2017
1 parent 505f2fb commit c9624b6
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.smarthome.config.core.Configuration;
import org.eclipse.smarthome.core.common.registry.Identifiable;
Expand All @@ -34,6 +34,7 @@
* @author Simon Kaufmann - Added label, location
* @author Kai Kreuzer - Removed linked items from Thing
*/
@NonNullByDefault
public interface Thing extends Identifiable<ThingUID> {

/** the key for the vendor property */
Expand Down Expand Up @@ -116,7 +117,7 @@ public interface Thing extends Identifiable<ThingUID> {
*
* @param thingHandler the new handler
*/
void setHandler(ThingHandler thingHandler);
void setHandler(@Nullable ThingHandler thingHandler);

/**
* Gets the handler.
Expand All @@ -139,14 +140,13 @@ public interface Thing extends Identifiable<ThingUID> {
*
* @param bridgeUID the new bridge UID
*/
void setBridgeUID(ThingUID bridgeUID);
void setBridgeUID(@Nullable ThingUID bridgeUID);

/**
* Gets the configuration.
*
* @return the configuration (not null)
*/
@NonNull
Configuration getConfiguration();

/**
Expand All @@ -169,8 +169,7 @@ public interface Thing extends Identifiable<ThingUID> {
*
* @return an immutable copy of the {@link Thing} properties (not null)
*/
@NonNull
Map<@NonNull String, String> getProperties();
Map<String, String> getProperties();

/**
* Sets the property value for the property identified by the given name. If the value to be set is null then the
Expand All @@ -180,14 +179,15 @@ public interface Thing extends Identifiable<ThingUID> {
* @param value the value of the property (if null then the property with the given name is removed)
* @return the previous value associated with the name, or null if there was no mapping for the name
*/
String setProperty(@NonNull String name, String value);
@Nullable
String setProperty(String name, @Nullable String value);

/**
* Updates all properties of the thing.
*
* @param properties the properties to set (must not be null)
*/
void setProperties(@NonNull Map<String, String> properties);
void setProperties(Map<String, String> properties);

/**
* Get the physical location of the {@link Thing}.
Expand All @@ -203,6 +203,6 @@ public interface Thing extends Identifiable<ThingUID> {
* @param location the location identifier (preferably an item name) or {@code null} if no location has been
* configured.
*/
void setLocation(String location);
void setLocation(@Nullable String location);

}

0 comments on commit c9624b6

Please sign in to comment.