Returns a {@link Collection} of {@link Entity}s for which associated {@link EntityAnnotation}s has a confidence value
greater than or equal to the value passed by parameter

@param confidenceValue Threshold confidence value
@return
545065
public Collection<Entity> getEntitiesByConfidenceValue(final Double confidenceValue) {

        Collection<EntityAnnotation> sortedEas = getEntityAnnotationsByConfidenceValue(confidenceValue);

        return Collections2.transform(sortedEas,
                new Function<EntityAnnotation, Entity>() {
                    @Override
                    public Entity apply(final EntityAnnotation ea) {
                        return ea.getEntityReference();
                    }
                }
        );
    }
1312462
@Override
    public List<Object> findByRelation(String colName, Object colValue, Class entityClazz)
    {
        // find by relational value !

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClazz);
        MetamodelImpl metamodel = (MetamodelImpl) KunderaMetadataManager.getMetamodel(kunderaMetadata,
                entityMetadata.getPersistenceUnit());

        EntityType entityType = metamodel.entity(entityMetadata.getEntityClazz());

        Table schemaTable = tableAPI.getTable(entityMetadata.getTableName());

        Iterator<Row> rowsIter = null;
        if (schemaTable.getPrimaryKey().contains(colName))
        {
            PrimaryKey rowKey = schemaTable.createPrimaryKey();
            NoSqlDBUtils.add(schemaTable.getField(colName), rowKey, colValue, colName);
            rowsIter = tableAPI.tableIterator(rowKey, null, null);
        }
        else
        {
            Index index = schemaTable.getIndex(colName);
            IndexKey indexKey = index.createIndexKey();
            NoSqlDBUtils.add(schemaTable.getField(colName), indexKey, colValue, colName);
            rowsIter = tableAPI.tableIterator(indexKey, null, null);
        }

        try
        {
            Map<String, Object> relationMap = initialize(entityMetadata);

            return scrollAndPopulate(null, entityMetadata, metamodel, schemaTable, rowsIter, relationMap, null);
        }
        catch (Exception e)
        {
            log.error("Error while finding data for Key " + colName + ", Caused By :" + e + ".");
            throw new PersistenceException(e);
        }

    }
1256099
int[] getValue() {
    int maxConfidence = -1;
    Collection<Integer> result = new ArrayList<>();
    for (Entry<Integer,Integer> entry : values.entrySet()) {
      if (entry.getValue() > maxConfidence) {
        maxConfidence = entry.getValue();
        result.clear();
        result.add(entry.getKey());
      } else if (entry.getValue() == maxConfidence) {
        result.add(entry.getKey());
      }
    }
    return PDF417Common.toIntArray(result);
  }
671381
public List<CmsEntity> getComplexValues() {

        List<CmsEntity> result = new ArrayList<CmsEntity>();
        result.addAll(m_entityValues);
        return Collections.unmodifiableList(result);
    }
108102
public synchronized boolean contains(EvidenceType type, Confidence confidence) {
        if (null == type) {
            return false;
        }
        final Set<Evidence> col;
        switch (type) {
            case VENDOR:
                col = vendors;
                break;
            case PRODUCT:
                col = products;
                break;
            case VERSION:
                col = versions;
                break;
            default:
                return false;
        }
        for (Evidence e : col) {
            if (e.getConfidence().equals(confidence)) {
                return true;
            }
        }
        return false;
    }
810291
public ReferenceSpec[] referencesTo(EntitySpec entitySpec) {
        if (entitySpec == null) {
            throw new IllegalArgumentException("entitySpec cannot be null");
        }

        List<ReferenceSpec> result = new ArrayList<>();
        String entitySpecName = entitySpec.name;
        for (ReferenceSpec refSpec : this.referenceSpecs) {
            if (refSpec.getEntityName().equals(entitySpecName)) {
                result.add(refSpec);
            }
        }
        return result.toArray(new ReferenceSpec[result.size()]);
    }
552970
public static Collection<TypeQualifierValue<?>> getComplementaryExclusiveTypeQualifierValue(TypeQualifierValue<?> tqv) {
        assert tqv.isExclusiveQualifier();

        LinkedList<TypeQualifierValue<?>> result = new LinkedList<>();

        for (TypeQualifierValue<?> t : instance.get().allKnownTypeQualifiers) {
            //
            // Any TypeQualifierValue with the same
            // annotation class but a different value is a complementary
            // type qualifier.
            //
            if (t.typeQualifier.equals(tqv.typeQualifier) && !Objects.equals(t.value, tqv.value)) {
                result.add(t);
            }
        }

        return result;
    }
282911
public List<Object> parseListElement(Element collectionEle, BeanDefinition bd) {
    String defaultElementType = collectionEle.getAttribute(VALUE_TYPE_ATTRIBUTE);
    NodeList nl = collectionEle.getChildNodes();
    ManagedList<Object> target = new ManagedList<Object>(nl.getLength());
    target.setSource(extractSource(collectionEle));
    target.setElementTypeName(defaultElementType);
    target.setMergeEnabled(parseMergeAttribute(collectionEle));
    parseCollectionElements(nl, target, bd, defaultElementType);
    return target;
  }
377317
public List<Object> getEntities() {
		List<Object> entitiesList = new LinkedList<Object>();

		for (Result result : results) {
			entitiesList.add(result.getObject());
		}

		return entitiesList;
	}
91875
public Entity getEntityByName(String entityName) {
        Entity entity = currentEntitiesByName.get(entityName.toUpperCase());
        Assert.notNull(entity, "You must be sure that an entity is present. Entity name=" + entityName);
        return entity;
    }
482506
@Override
    public List<Object> findByRelation(String colName, Object colValue, Class entityClazz)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClazz);
        Object[] ids = findIdsByColumn(entityMetadata.getTableName(), colName, colValue);
        List<Object> resultSet = new ArrayList<Object>();
        if (ids != null)
        {
            // just to insure uniqueness.

            for (Object id : new HashSet(Arrays.asList(ids)))
            {
                resultSet.add(find(entityClazz, id));
            }
        }

        return resultSet;
    }
1295605
@SuppressWarnings("rawtypes")
    private Map<EntitySpec, SQLGenResultProcessorFactory> allEntitySpecToResultProcessor() {
        /*
         * The order of the entity specs matters for multiple with the same
         * name. Thus, we use a LinkedHashMap.
         */
        Map<EntitySpec, SQLGenResultProcessorFactory> result = new LinkedHashMap<>();
        PrimitiveParameterResultProcessorFactory ppFactory = new PrimitiveParameterResultProcessorFactory(this.backend);
        for (EntitySpec es : this.primitiveParameterEntitySpecs) {
            result.put(es, ppFactory);
        }
        EventResultProcessorFactory eFactory = new EventResultProcessorFactory(this.backend);
        for (EntitySpec es : this.eventEntitySpecs) {
            result.put(es, eFactory);
        }
        ConstantResultProcessorFactory cFactory = new ConstantResultProcessorFactory(this.backend);
        for (EntitySpec es : this.constantEntitySpecs) {
            result.put(es, cFactory);
        }

        return result;
    }
1157953
@SuppressWarnings("unchecked")
  @Override
  public <T> List<T> getCollection(Class<T> entityClass) {
    String collectionName = Util.determineCollectionName(entityClass);
    Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
    if (null == collection) {
      createCollection(collectionName);
      collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
    }

    CollectionMetaData cmd = cmdMap.get(collectionName);
    List<T> newCollection = new ArrayList<T>();
    try {
      for (T document : collection.values()) {
        Object obj = Util.deepCopy(document);
        if(encrypted && cmd.hasSecret() && null != obj) {
          CryptoUtil.decryptFields(obj, cmd, dbConfig.getCipher());
        }
        newCollection.add((T) obj);
      }
    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      logger.error("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
      throw new JsonDBException("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
    }
    return newCollection;
  }
1339184
private List returnEntityObjectList(EntityMetadata m, List<HBaseDataWrapper> results, List outputResults)
    {
        Map<Object, Object> entityListMap = new HashMap<Object, Object>();
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                m.getPersistenceUnit());
        EntityType entityType = metaModel.entity(m.getEntityClazz());
        List<AbstractManagedType> subManagedTypes = ((AbstractManagedType) entityType).getSubManagedType();
        Map<String, Class> discrValueToEntityClazz = new HashMap<String, Class>();
        String discrColumn = null;
        if (subManagedTypes != null && !subManagedTypes.isEmpty())
        {
            for (AbstractManagedType subEntity : subManagedTypes)
            {
                discrColumn = ((AbstractManagedType) subEntity).getDiscriminatorColumn();
                discrValueToEntityClazz.put(subEntity.getDiscriminatorValue(), subEntity.getJavaType());
            }
        }
        for (HBaseDataWrapper data : results)
        {
            Class clazz = null;
            if (discrValueToEntityClazz != null && !discrValueToEntityClazz.isEmpty())
            {
                String discrColumnKey = HBaseUtils.getColumnDataKey(m.getTableName(), discrColumn);
                String discrValue = Bytes.toString(data.getColumnValue(discrColumnKey));
                clazz = discrValueToEntityClazz.get(discrValue);
                m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, clazz);
            }
            else
            {
                clazz = m.getEntityClazz();
            }

            Object entity = KunderaCoreUtils.createNewInstance(clazz); // Entity
            Object rowKeyValue = HBaseUtils.fromBytes(m, metaModel, data.getRowKey());
            if (!metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType()))
            {
                PropertyAccessorHelper.setId(entity, m, rowKeyValue);
            }
            if (entityListMap.get(rowKeyValue) != null)
            {
                entity = entityListMap.get(rowKeyValue);
            }
            entity = populateEntityFromHBaseData(entity, data, m, null);
            if (entity != null)
            {
                entityListMap.put(rowKeyValue, entity);
            }
        }
        for (Object obj : entityListMap.values())
        {
            outputResults.add(obj);
        }
        return outputResults;
    }
13864
@Override
    public List<Object> findByRelation(String colName, Object colValue, Class entityClazz)
    {
        EntityMetadata m = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClazz);
        Object[] ids = findIdsByColumn(m.getSchema(), m.getTableName(),
                ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName(), colName, colValue, m.getEntityClazz());
        List<Object> resultSet = new ArrayList<Object>();
        if (ids != null)
        {
            for (Object id : new HashSet(Arrays.asList(ids)))
            {
                Object object = find(entityClazz, id);
                if (object != null)
                {
                    resultSet.add(object);
                }
            }
        }
        return resultSet;
    }
766794
private Collection getInValuesCollection(Expression inClauseValues)
    {
        Collection inParameterCollection = new ArrayList<>();
        if (inClauseValues instanceof NullExpression)
        {
            log.debug("No items passed in IN clause values, returning blank IN values list");
            return inParameterCollection;
        }

        if (inClauseValues instanceof InputParameter)
        {
            Object inValues = kunderaQuery.getParametersMap().get(inClauseValues.toParsedText());
            log.debug(inClauseValues.toParsedText() + "named parameter found in query, Replacing parameter with "
                    + inValues);

            inParameterCollection = inValues.getClass().isArray() ? Arrays.asList((Object[]) inValues)
                    : (Collection) kunderaQuery.getParametersMap().get(inClauseValues.toParsedText());

            return inParameterCollection;
        }

        if (inClauseValues instanceof CollectionExpression)
        {
            Iterator inValueIterator = ((CollectionExpression) inClauseValues).children().iterator();

            log.debug("Collection object found for IN clause values");
            while (inValueIterator.hasNext())
            {
                Expression value = (Expression) inValueIterator.next();
                inParameterCollection.add(value.toParsedText());
            }
            return inParameterCollection;
        }

        throw new KunderaException(inClauseValues.toParsedText() + " not supported for IN clause");
    }
1156952
@SuppressWarnings("static-method")
	public Boolean findBooleanValue(JvmAnnotationReference reference) {
		assert reference != null;
		for (final JvmAnnotationValue value : reference.getValues()) {
			if (value instanceof JvmBooleanAnnotationValue) {
				for (final Boolean intValue : ((JvmBooleanAnnotationValue) value).getValues()) {
					if (intValue != null) {
						return intValue;
					}
				}
			}
		}
		return null;
	}