Define zero argument contructoris for the serializer
Change-Id: I1c5f4a526f886ffb85b1a9d03d661161f66d076b
Showing
2 changed files
with
12 additions
and
0 deletions
| ... | @@ -39,6 +39,12 @@ public final class ContinuousResource implements Resource { | ... | @@ -39,6 +39,12 @@ public final class ContinuousResource implements Resource { |
| 39 | this.value = value; | 39 | this.value = value; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | + // for serializer | ||
| 43 | + ContinuousResource() { | ||
| 44 | + this.id = null; | ||
| 45 | + this.value = 0; | ||
| 46 | + } | ||
| 47 | + | ||
| 42 | @Override | 48 | @Override |
| 43 | public ContinuousResourceId id() { | 49 | public ContinuousResourceId id() { |
| 44 | return id; | 50 | return id; | ... | ... |
| ... | @@ -46,6 +46,12 @@ public final class ContinuousResourceId extends ResourceId { | ... | @@ -46,6 +46,12 @@ public final class ContinuousResourceId extends ResourceId { |
| 46 | this.name = last.getSimpleName(); | 46 | this.name = last.getSimpleName(); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | + // for serializer | ||
| 50 | + ContinuousResourceId() { | ||
| 51 | + this.components = ImmutableList.of(); | ||
| 52 | + this.name = ""; | ||
| 53 | + } | ||
| 54 | + | ||
| 49 | ImmutableList<Object> components() { | 55 | ImmutableList<Object> components() { |
| 50 | return components; | 56 | return components; |
| 51 | } | 57 | } | ... | ... |
-
Please register or login to post a comment