org.joinedworkz.common.OpenApiGeneratorContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-base Show documentation
Show all versions of common-base Show documentation
DSL based modeling framework - facilities common base
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;
}
}