Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/397#discussion_r21855943
--- Diff: core/src/main/java/brooklyn/event/basic/BasicAttributeSensor.java
---
@@ -42,7 +46,17 @@ public BasicAttributeSensor(TypeToken<T> typeToken,
String name) {
}
public BasicAttributeSensor(TypeToken<T> typeToken, String name,
String description) {
+ this(typeToken, name, description, SensorPersistenceMode.REQUIRED);
+ }
+
+ public BasicAttributeSensor(TypeToken<T> typeToken, String name,
String description, SensorPersistenceMode persistence) {
super(typeToken, name, description);
+ this.persistence = checkNotNull(persistence, "persistence");
+ }
+
+ @Override
+ public SensorPersistenceMode getPersistenceMode() {
+ return persistence;
--- End diff --
is it worth adding if it's null to return `REQUIRED`, to prevent old
persisted items from returning `null` here?
or have an explicit `@Nullable`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---