package org.jetbrains.debugger;

import com.intellij.util.BitUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.debugger.values.FunctionValue;
import org.jetbrains.debugger.values.Value;

public class ObjectPropertyImpl extends VariableImpl implements ObjectProperty {
  public static final byte WRITABLE = 0x01;
  public static final byte CONFIGURABLE = 0x02;
  public static final byte ENUMERABLE = 0x04;

  private final FunctionValue getter;
  private final FunctionValue setter;

  private final int flags;

  public ObjectPropertyImpl(@NotNull String name,
                            @Nullable Value value,
                            @Nullable FunctionValue getter,
                            @Nullable FunctionValue setter,
                            @Nullable ValueModifier valueModifier,
                            int flags) {
    super(name, value, valueModifier);

    this.getter = getter;
    this.setter = setter;

    this.flags = flags;
  }

  @Nullable
  @Override
  public final FunctionValue getGetter() {
    return getter;
  }

  @Nullable
  @Override
  public final FunctionValue getSetter() {
    return setter;
  }

  @Override
  public final boolean isWritable() {
    return BitUtil.isSet(flags, WRITABLE);
  }

  @Override
  public final boolean isConfigurable() {
    return BitUtil.isSet(flags, CONFIGURABLE);
  }

  @Override
  public final boolean isEnumerable() {
    return BitUtil.isSet(flags, ENUMERABLE);
  }
}
@@ -23,17 +23,16 @@
 debugger
-;
 %0A%0Aimport
@@ -61,94 +61,8 @@
 Util
-;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;
 %0Aimp
@@ -108,17 +108,16 @@
 ionValue
-;
 %0Aimport 
@@ -155,18 +155,10 @@
 alue
-;
 %0A%0A
-public 
 clas
@@ -181,440 +181,107 @@
 Impl
- extends VariableImpl implements ObjectProperty %7B%0A  public static final byte WRITABLE = 0x01;%0A  public static final byte CONFIGURABLE = 0x02;%0A  public static final byte ENUMERABLE = 0x04;%0A%0A  private final FunctionValue getter;%0A  private final FunctionValue setter;%0A%0A  private final int flags;%0A%0A  public ObjectPropertyImpl(@NotNull String name,%0A                            @Nullable Value value,%0A                            @Nullable
+(name: String,%0A                         value: Value?,%0A                         private val getter:
  Fun
@@ -290,23 +290,17 @@
 ionValue
- getter
+?
 ,%0A      
@@ -318,28 +318,35 @@
         
-   @Nullable
+private val setter:
  Functio
@@ -351,23 +351,17 @@
 ionValue
- setter
+?
 ,%0A      
@@ -383,22 +383,9 @@
     
-   @Nullable V
+v
 alue
@@ -392,18 +392,19 @@
 Modifier
- v
+: V
 alueModi
@@ -407,16 +407,17 @@
 Modifier
+?
 ,%0A      
@@ -439,184 +439,121 @@
     
-  
- int flags) %7B%0A    super(name, value, valueModifier);%0A%0A    this.getter = getter;%0A    this.setter = setter;%0A%0A    this.flags = flags;%0A  %7D%0A%0A  @Nullable%0A  @Override%0A  public final
+private val flags: Int) : VariableImpl(name, value, valueModifier), ObjectProperty %7B%0A%0A  override fun getGetter():
  Fun
@@ -562,28 +562,17 @@
 ionValue
- getGetter()
+?
  %7B%0A    r
@@ -583,25 +583,24 @@
 n getter
-;
 %0A  %7D%0A%0A  
 @Nullabl
@@ -595,44 +595,33 @@
 %0A%0A  
-@Nullable%0A  @Override%0A  public final
+override fun getSetter():
  Fun
@@ -630,28 +630,17 @@
 ionValue
- getSetter()
+?
  %7B%0A    r
@@ -651,25 +651,24 @@
 n setter
-;
 %0A  %7D%0A%0A  
 @Overrid
@@ -663,39 +663,19 @@
 %0A%0A  
-@O
+o
 verride
-%0A  public final boolea
+ fu
 n is
@@ -680,24 +680,33 @@
 isWritable()
+: Boolean
  %7B%0A    retur
@@ -732,34 +732,41 @@
 gs, WRITABLE
+.toInt()
 )
-;
 %0A  %7D%0A%0A  
 @Override%0A  
@@ -757,39 +757,19 @@
 %0A%0A  
-@O
+o
 verride
-%0A  public final boolea
+ fu
 n is
@@ -778,24 +778,33 @@
 nfigurable()
+: Boolean
  %7B%0A    retur
@@ -842,18 +842,25 @@
 ABLE
+.toInt()
 )
-;
 %0A  %7D%0A%0A  
 @Ove
@@ -859,39 +859,19 @@
 %0A%0A  
-@O
+o
 verride
-%0A  public final boolea
+ fu
 n is
@@ -882,16 +882,25 @@
 erable()
+: Boolean
  %7B%0A    r
@@ -940,10 +940,139 @@
 ABLE
-);
+.toInt())%0A  %7D%0A%0A  companion object %7B%0A    val WRITABLE: Byte = 0x01%0A    val CONFIGURABLE: Byte = 0x02%0A    val ENUMERABLE: Byte = 0x04
 %0A  %7D

convert ObjectPropertyImpl to kotlin