public override void SetResource(Resource resource)
 {
     MaybeInitBuilder();
     if (resource == null)
     {
         builder.ClearResource();
     }
     this.resource = resource;
 }