Sho SHIMIZU
Committed by Gerrit Code Review

Create constructors with zero argument for serialization

Change-Id: I503197a2dcfe1b71dc6a82d4c2ca4512465200c5
...@@ -44,6 +44,12 @@ public class DefaultResource<S, T> implements Resource<S, T> { ...@@ -44,6 +44,12 @@ public class DefaultResource<S, T> implements Resource<S, T> {
44 this.resource = checkNotNull(resource); 44 this.resource = checkNotNull(resource);
45 } 45 }
46 46
47 + // for serialization
48 + private DefaultResource() {
49 + this.subject = null;
50 + this.resource = null;
51 + }
52 +
47 @Override 53 @Override
48 public S subject() { 54 public S subject() {
49 return subject; 55 return subject;
......
...@@ -47,6 +47,13 @@ public class DefaultResourceAllocation<S, T> implements ResourceAllocation<S, T> ...@@ -47,6 +47,13 @@ public class DefaultResourceAllocation<S, T> implements ResourceAllocation<S, T>
47 this.consumer = consumer; 47 this.consumer = consumer;
48 } 48 }
49 49
50 + // for serialization
51 + private DefaultResourceAllocation() {
52 + this.subject = null;
53 + this.resource = null;
54 + this.consumer = null;
55 + }
56 +
50 @Override 57 @Override
51 public S subject() { 58 public S subject() {
52 return subject; 59 return subject;
......