use of org.applause.lang.applauseDsl.RESTVerb in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForCreate.
public String dataAccessMethodNameForCreate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.POST);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.RESTVerb in project applause by applause.
the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForUpdate.
public String dataAccessMethodNameForUpdate(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.PUT);
return Boolean.valueOf(_equals);
}
};
DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
String _name = _findFirst.getName();
return _name;
}
use of org.applause.lang.applauseDsl.RESTVerb in project applause by applause.
the class DefaultListScreenEditActionCompiler method deleteMethod.
public DataSourceAccessMethod deleteMethod(final Screen it) {
DataSourceCall _datasource = it.getDatasource();
DataSource _datasource_1 = _datasource.getDatasource();
EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {
public Boolean apply(final DataSourceAccessMethod it) {
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
boolean _equals = Objects.equal(_verb, RESTVerb.DELETE);
return Boolean.valueOf(_equals);
}
};
Iterable<DataSourceAccessMethod> _filter = IterableExtensions.<DataSourceAccessMethod>filter(_methods, _function);
DataSourceAccessMethod _head = IterableExtensions.<DataSourceAccessMethod>head(_filter);
return _head;
}
use of org.applause.lang.applauseDsl.RESTVerb in project applause by applause.
the class EntityDataAccessHeaderFileCompiler method compileRESTMethod.
public CharSequence compileRESTMethod(final DataSourceAccessMethod it) {
CharSequence _switchResult = null;
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
final RESTVerb _switchValue = _verb;
boolean _matched = false;
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.GET)) {
_matched = true;
CharSequence _compileGETLISTMethod = this.compileGETLISTMethod(it);
_switchResult = _compileGETLISTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.POST)) {
_matched = true;
CharSequence _compilePOSTMethod = this.compilePOSTMethod(it);
_switchResult = _compilePOSTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.PUT)) {
_matched = true;
CharSequence _compilePUTMethod = this.compilePUTMethod(it);
_switchResult = _compilePUTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.DELETE)) {
_matched = true;
CharSequence _compileDELETEMethod = this.compileDELETEMethod(it);
_switchResult = _compileDELETEMethod;
}
}
return _switchResult;
}
use of org.applause.lang.applauseDsl.RESTVerb in project applause by applause.
the class EntityDataAccessModuleFileCompiler method compileRESTMethod.
public CharSequence compileRESTMethod(final DataSourceAccessMethod it) {
CharSequence _switchResult = null;
RESTSpecification _restSpecification = it.getRestSpecification();
RESTVerb _verb = _restSpecification.getVerb();
final RESTVerb _switchValue = _verb;
boolean _matched = false;
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.GET)) {
_matched = true;
CharSequence _compileGETLISTMethod = this.compileGETLISTMethod(it);
_switchResult = _compileGETLISTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.POST)) {
_matched = true;
CharSequence _compilePOSTMethod = this.compilePOSTMethod(it);
_switchResult = _compilePOSTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.PUT)) {
_matched = true;
CharSequence _compilePUTMethod = this.compilePUTMethod(it);
_switchResult = _compilePUTMethod;
}
}
if (!_matched) {
if (Objects.equal(_switchValue, RESTVerb.DELETE)) {
_matched = true;
CharSequence _compileDELETEMethod = this.compileDELETEMethod(it);
_switchResult = _compileDELETEMethod;
}
}
return _switchResult;
}
Aggregations