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

com.reprezen.genflow.openapi3.doc.MiscHelper Maven / Gradle / Ivy

package com.reprezen.genflow.openapi3.doc;

import com.reprezen.genflow.api.normal.openapi.RepreZenVendorExtension;
import com.reprezen.genflow.openapi3.doc.AttributeHelper;
import com.reprezen.genflow.openapi3.doc.Helper;
import com.reprezen.genflow.openapi3.doc.HelperHelper;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;

@SuppressWarnings("all")
public class MiscHelper implements Helper {
  @Extension
  private AttributeHelper attributeHelper;
  
  @Override
  public void init() {
    this.attributeHelper = HelperHelper.getAttributeHelper();
  }
  
  public  List sortByPosition(final Collection keys, final Map map) {
    final Function1 _function = (K it) -> {
      Integer _elvis = null;
      V _get = map.get(it);
      RepreZenVendorExtension _rZVE = null;
      if (_get!=null) {
        _rZVE=this.attributeHelper.getRZVE(_get);
      }
      Integer _position = null;
      if (_rZVE!=null) {
        _position=_rZVE.getPosition();
      }
      if (_position != null) {
        _elvis = _position;
      } else {
        _elvis = Integer.valueOf(Integer.MAX_VALUE);
      }
      return _elvis;
    };
    return IterableExtensions.sortBy(keys, _function);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy