/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.facebook.litho.editor.instances;

import com.facebook.litho.editor.Editor;
import com.facebook.litho.editor.model.EditorBool;
import com.facebook.litho.editor.model.EditorValue;
import java.lang.reflect.Field;

public class BoolEditorInstance implements Editor {

  @Override
  public EditorValue read(Field f, Object node) {
    return EditorValue.bool(EditorUtils.<Boolean>getNodeUNSAFE(f, node));
  }

  @Override
  public boolean write(final Field f, final Object node, final EditorValue values) {
    values.when(
        new EditorValue.DefaultEditorVisitor() {
          @Override
          public Void isBool(EditorBool bool) {
            EditorUtils.setNodeUNSAFE(f, node, bool.value);
            return null;
          }
        });
    return true;
  }
}

@@ -925,24 +925,30 @@
 ue read(
+final 
 Field f,
  Object 
@@ -939,16 +939,22 @@
 Field f,
+ final
  Object 
@@ -969,32 +969,139 @@
     
-return EditorValue.bool(
+// If you use Boolean here it causes an exception when attempting to do implicit conversion to%0A    // boolean%0A    final Object b = 
 Edit
@@ -1109,23 +1109,22 @@
 rUtils.%3C
-Boolean
+Object
 %3EgetNode
@@ -1138,16 +1138,98 @@
 f, node)
+;%0A    return b == null ? EditorValue.string(%22null%22) : EditorValue.bool((Boolean) b
 );%0A  %7D%0A%0A
@@ -1411,16 +1411,16 @@
 verride%0A
-
         
@@ -1440,16 +1440,22 @@
  isBool(
+final 
 EditorBo

Add support for nullable Booleans