All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.joinedworkz.common.OpenApiGeneratorContext Maven / Gradle / Ivy

There is a newer version: 1.3.46
Show newest version
package org.joinedworkz.common;

import java.util.Objects;
import java.util.Set;
import org.eclipse.xtend.lib.annotations.Accessors;
import org.eclipse.xtext.xbase.lib.Pure;
import org.joinedworkz.common.context.CommonGeneratorContext;
import org.joinedworkz.core.facility.Outlet;
import org.joinedworkz.core.model.CmnModel;
import org.joinedworkz.core.model.CmnType;

@Accessors
@SuppressWarnings("all")
public class OpenApiGeneratorContext extends CommonGeneratorContext {
  protected final CmnModel model;

  public final Outlet htmlOutlet;

  public OpenApiGeneratorContext(final CmnModel model, final Outlet defaultOutlet, final Outlet htmlOutlet) {
    super(defaultOutlet);
    this.htmlOutlet = htmlOutlet;
    this.model = model;
  }

  public OpenApiGeneratorContext addUsedType(final CmnType type) {
    Set _usedTypes = this.getUsedTypes();
    for (final CmnType usedType : _usedTypes) {
      String _name = type.getName();
      String _name_1 = usedType.getName();
      boolean _equals = Objects.equals(_name, _name_1);
      if (_equals) {
        return this;
      }
    }
    this.getUsedTypes().add(type);
    return this;
  }

  @Pure
  public CmnModel getModel() {
    return this.model;
  }

  @Pure
  public Outlet getHtmlOutlet() {
    return this.htmlOutlet;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy