package jetbrains.mps.kotlin.stubs.common.metadata;

/*Generated by MPS */

import jetbrains.mps.annotations.GeneratedClass;
import kotlinx.metadata.KmExtensionVisitor;
import kotlinx.metadata.KmExtensionType;
import kotlin.jvm.JvmClassMappingKt;
import java.util.List;
import kotlinx.metadata.KmAnnotation;
import jetbrains.mps.references.Reference;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import java.util.ArrayList;
import org.jetbrains.annotations.NotNull;

@GeneratedClass(node = "r:d76e16ee-a528-4ca0-b2d6-9eed9a9b1d1c(jetbrains.mps.kotlin.stubs.common.metadata)/4838924484790281678", model = "r:d76e16ee-a528-4ca0-b2d6-9eed9a9b1d1c(jetbrains.mps.kotlin.stubs.common.metadata)")
public class AnnotationExtension implements KmExtensionVisitor {
  public static final KmExtensionType type = new KmExtensionType(JvmClassMappingKt.getKotlinClass(AnnotationExtension.class));
  private List<KmAnnotation> myAnnotations;
  public List<KmAnnotation> getAnnotations() {
    return this.myAnnotations;
  }
  private void _setAnnotations(List<KmAnnotation> value) {
    this.myAnnotations = value;
  }
  private List<KmAnnotation> setAnnotations(List<KmAnnotation> value) {
    _setAnnotations(value);
    return value;
  }
  private Reference<List<KmAnnotation>> refToAnnotations() {
    return new Reference<List<KmAnnotation>>() {
      public List<KmAnnotation> get() {
        return getAnnotations();
      }
      public void set(List<KmAnnotation> value) {
        _setAnnotations(value);
      }
    };
  }

  public AnnotationExtension() {
    this.setAnnotations(ListSequence.fromList(new ArrayList<KmAnnotation>()));
  }

  @NotNull
  public KmExtensionType getType() {
    return type;
  }

  public void addAnnotations(KmAnnotation annotation) {
    ListSequence.fromList(getAnnotations()).addElement(annotation);
  }
}
