Utility method that employs some heuristics to find the {@link EntityInfo}s
for the polymeric chains given in constructor.
To be used in case the information is missing in PDB/mmCIF file
@return
343755
public static List<EntityInfo> findPolyEntities(List<List<Chain>> polyModels) {
		TreeMap<String,EntityInfo> chainIds2entities = findEntitiesFromAlignment(polyModels);

		List<EntityInfo> entities = findUniqueEntities(chainIds2entities);

		return entities;
	}
1116434
public GraphObject getEntity() throws FrameworkException {

		final GraphObject entity = idResource.getEntity();
		if (entity != null) {

			final String type       = SchemaHelper.normalizeEntityName(typeResource.getRawType());
			final String entityType = entity.getClass().getSimpleName();

			if (GenericNode.class.equals(entity.getClass()) || SearchCommand.getAllSubtypesAsStringSet(type).contains(entityType)) {
				return entity;
			}
		}

		throw new NotFoundException("Entity with ID " + idResource.getUuid() + " not found");
	}
634678
public FieldDescriptor[] getPkFields()
    {
        if (m_PkFieldDescriptors == null)
        {
            // 1. collect all Primary Key fields from Field list
            Vector vec = new Vector();
            // 1.a if descriptor describes an interface: take PK fields from an implementors ClassDescriptor
            if (m_isInterface)
            {
                if (getExtentClasses().size() == 0)
                {
                    throw new PersistenceBrokerException(
                        "No Implementors declared for interface "
                            + this.getClassOfObject().getName());
                }
                Class implementor = (Class) getExtentClasses().get(0);
                ClassDescriptor implCld = this.getRepository().getDescriptorFor(implementor);
                m_PkFieldDescriptors = implCld.getPkFields();
            }
            else
            {
                FieldDescriptor[] fields;
                // 1.b if not an interface The classdescriptor must have FieldDescriptors
                fields = getFieldDescriptions();
                // now collect all PK fields
                for (int i = 0; i < fields.length; i++)
                {
                    FieldDescriptor fd = fields[i];
                    if (fd.isPrimaryKey())
                    {
                        vec.add(fd);
                    }
                }
                // 2. Sort fields according to their getOrder() Property
                Collections.sort(vec, FieldDescriptor.getComparator());
                m_PkFieldDescriptors = (FieldDescriptor[]) vec.toArray(new FieldDescriptor[vec.size()]);
            }
        }
        return m_PkFieldDescriptors;
    }
1156632
public final String getEntityDeclaration() {
        if (entityDecl == null)
            try {
                entityDecl = createEntityDeclaration();
            } catch (Exception e) {
                entityDecl = null;
            }

        return entityDecl;
    }
730830
public Entity getEntities(int i) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_entities == null)
      jcasType.jcas.throwFeatMissing("entities", "de.julielab.jules.types.ace.Document");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_entities), i);
    return (Entity)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_entities), i)));}
241103
private String getSMRID(PhysicalEntity pe)
	{
		if (pe instanceof SmallMolecule)
		{
			EntityReference er = ((SmallMolecule) pe).getEntityReference();
			if (er != null) return er.getUri();
		}
		return null;
	}
641822
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "SPECIFICENTITY_MENTIONOF_PK")
    public org.openprovenance.prov.model.QualifiedName getSpecificEntity() {
        return specificEntity;
    }
1235219
public List<NamedEntityGraph<Entity<T>>> getAllNamedEntityGraph()
   {
      List<NamedEntityGraph<Entity<T>>> list = new ArrayList<NamedEntityGraph<Entity<T>>>();
      List<Node> nodeList = childNode.get("named-entity-graph");
      for(Node node: nodeList)
      {
         NamedEntityGraph<Entity<T>>  type = new NamedEntityGraphImpl<Entity<T>>(this, "named-entity-graph", childNode, node);
         list.add(type);
      }
      return list;
   }
488587
public final static List<PolymerNotation> getBLOBPolymers(List<PolymerNotation> polymers) {
    List<PolymerNotation> blobPolymers = new ArrayList<PolymerNotation>();
    for (PolymerNotation polymer : polymers) {
      if (polymer.getPolymerID() instanceof BlobEntity) {
        blobPolymers.add(polymer);
      }
    }
    return blobPolymers;
  }
1367349
@SuppressWarnings("unchecked")
    public Collection<EntityAnnotation> getEntityAnnotations() {
        Collection<? extends Enhancement> result = enhancements.get(EntityAnnotation.class);
        return result == null ? Collections.<EntityAnnotation>emptySet() : 
            Collections.unmodifiableCollection((Collection<EntityAnnotation>) result);
    }
83218
public List<JmsConnectionFactoryType<EntityBeanType<T>>> getAllJmsConnectionFactory()
   {
      List<JmsConnectionFactoryType<EntityBeanType<T>>> list = new ArrayList<JmsConnectionFactoryType<EntityBeanType<T>>>();
      List<Node> nodeList = childNode.get("jms-connection-factory");
      for(Node node: nodeList)
      {
         JmsConnectionFactoryType<EntityBeanType<T>>  type = new JmsConnectionFactoryTypeImpl<EntityBeanType<T>>(this, "jms-connection-factory", childNode, node);
         list.add(type);
      }
      return list;
   }
1160196
static Stream<Attribute> getJunctionTableAttributes(EntityType entityType) {
    // return all attributes referencing multiple entities except for one-to-many attributes that
    // are mapped by
    // another attribute
    return getPersistedAttributes(entityType)
        .filter(
            attr ->
                isMultipleReferenceType(attr)
                    && !(attr.getDataType() == ONE_TO_MANY && attr.isMappedBy()));
  }
350915
public List<Chain> getChains(){
		ArrayList<Chain> chains = new ArrayList<>();

		chains.addAll(polyChains);
		chains.addAll(nonPolyChains);
		chains.addAll(waterChains);

		chains.trimToSize();

		return chains;
	}
161914
public static String getJavaClassFromSchemaInfo(String schemaInfo) {
        final String ONLY_JAVA_CLIENTS_SUPPORTED = "Only Java clients are supported currently, so the format of the schema-info should be: <schema-info>java=foo.Bar</schema-info> where foo.Bar is the fully qualified name of the message.";

        if(StringUtils.isEmpty(schemaInfo))
            throw new IllegalArgumentException("This serializer requires a non-empty schema-info.");

        String[] languagePairs = StringUtils.split(schemaInfo, ',');
        if(languagePairs.length > 1)
            throw new IllegalArgumentException(ONLY_JAVA_CLIENTS_SUPPORTED);

        String[] javaPair = StringUtils.split(languagePairs[0], '=');
        if(javaPair.length != 2 || !javaPair[0].trim().equals("java"))
            throw new IllegalArgumentException(ONLY_JAVA_CLIENTS_SUPPORTED);

        return javaPair[1].trim();
    }
808101
public List<String> getAttributeIdentifiers(EntityType sourceEntityType) {
    Entity entityTypeEntity =
        dataService.findOne(
            ENTITY_TYPE_META_DATA,
            new QueryImpl<>().eq(EntityTypeMetadata.ID, sourceEntityType.getId()));

    if (entityTypeEntity == null)
      throw new MolgenisDataAccessException(
          "Could not find EntityTypeEntity by the name of " + sourceEntityType.getId());

    List<String> attributeIdentifiers = new ArrayList<>();

    recursivelyCollectAttributeIdentifiers(
        entityTypeEntity.getEntities(EntityTypeMetadata.ATTRIBUTES), attributeIdentifiers);

    return attributeIdentifiers;
  }
800066
public List<Converter<EntityMappings<T>>> getAllConverter()
   {
      List<Converter<EntityMappings<T>>> list = new ArrayList<Converter<EntityMappings<T>>>();
      List<Node> nodeList = childNode.get("converter");
      for(Node node: nodeList)
      {
         Converter<EntityMappings<T>>  type = new ConverterImpl<EntityMappings<T>>(this, "converter", childNode, node);
         list.add(type);
      }
      return list;
   }
1358740
public Annotation getFirstEntity() {
    if (Cooccurrence_Type.featOkTst && ((Cooccurrence_Type)jcasType).casFeat_firstEntity == null)
      jcasType.jcas.throwFeatMissing("firstEntity", "ch.epfl.bbp.uima.types.Cooccurrence");
    return (Annotation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Cooccurrence_Type)jcasType).casFeatCode_firstEntity)));}