Returns an <code>IEntity</code> representing a portal entity. This does not guarantee that
the entity actually exists.
978913
@Override
    public IEntity getEntity(String key, Class type) throws GroupsException {
        return getEntity(key, type, null);
    }
1245166
def getEntity(self, id=None, uri=None, match=None):
        

        if not id and not uri and not match:
            return None

        if type(id) == type("string"):
            uri = id
            id = None
            if not uri.startswith("http://"):
                match = uri
                uri = None
        if match:
            if type(match) != type("string"):
                return []
            res = []
            if ":" in match: # qname
                for x in self.classes:
                    if match.lower() in x.qname.lower():
                        res += [x]
                for x in self.properties:
                    if match.lower() in x.qname.lower():
                        res += [x]
            else:
                for x in self.classes:
                    if match.lower() in x.uri.lower():
                        res += [x]
                for x in self.properties:
                    if match.lower() in x.uri.lower():
                        res += [x]
            return res
        else:
            for x in self.classes:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            for x in self.properties:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            return None
875521
public Entity getEntity(String id) {
        Entity e = getEntities().get(id);
        if (e == null) {
            return null;
        }
        return e;
    }
238932
private Entity lookupEntity(String sid) {
        for (Integer i = 0; i < getEntities().size(); i++) {
            Entity e = getEntities().get(i);
            if (e != null && sid.compareTo(EntityContainer.buildId(e.getId())) == 0) {
                return getEntity(e.getId());
            }
        }
        return null;
    }
540238
private static HttpEntity entityFromConnection(HttpURLConnection connection) {
        BasicHttpEntity entity = new BasicHttpEntity();
        InputStream inputStream;
        try {
            inputStream = connection.getInputStream();
        } catch (IOException ioe) {
            inputStream = connection.getErrorStream();
        }
        entity.setContent(inputStream);
        entity.setContentLength(connection.getContentLength());
        entity.setContentEncoding(connection.getContentEncoding());
        entity.setContentType(connection.getContentType());
        return entity;
    }
1139559
@Override
    public boolean existsInStore(IEntityLock lock) throws LockingException {
        Class entityType = lock.getEntityType();
        String key = lock.getEntityKey();
        Integer lockType = lock.getLockType();
        Date expiration = lock.getExpirationTime();
        String owner = lock.getLockOwner();
        IEntityLock[] lockArray = getLockStore().find(entityType, key, lockType, expiration, owner);

        return (lockArray.length > 0);
    }
755389
public static HttpEntity newStringEntity(String s) {
        try {
            return new StringEntity(s);
        } catch (UnsupportedEncodingException e) {
            throw new SdkClientException("Unable to create HTTP entity: " + e.getMessage(), e);
        }
    }
361564
public static Optional<Entity> randomEntity(final EntityContainer container) {
	return randomEntity0(container.streamEntities(), container.getEntityCount());
    }
10571
public Entity newEntity(QualifiedName id, String label) {
	Entity res = newEntity(id);
	if (label != null)
	    res.getLabel().add(newInternationalizedString(label));
	return res;
    }
1100504
@Override
    public IPortletEntity getPortletEntity(
            HttpServletRequest request, String portletEntityIdString) {
        final IPortletEntityId portletEntityId =
                this.parseConsistentPortletEntityId(request, portletEntityIdString);
        return this.getPortletEntity(request, portletEntityId);
    }
950077
public ORID getIdentity() {
		if(orid!=null) return orid;
		ODocument doc = getObject();
		return doc!=null?doc.getIdentity():null;
	}
1033915
public Entity<OrmDescriptor> getOrCreateEntity()
   {
      List<Node> nodeList = model.get("entity");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EntityImpl<OrmDescriptor>(this, "entity", model, nodeList.get(0));
      }
      return createEntity();
   }
1187986
async def get_entity(self):
        
        if not self.entity and await self.get_input_entity():
            try:
                self._entity =\
                    await self._client.get_entity(self._input_entity)
            except ValueError:
                pass

        return self._entity
1015959
protected static Optional<String> getEntityIdAsParameter(final Service service) {
        try {
            val builder = new URIBuilder(service.getId());
            val param = builder.getQueryParams()
                .stream()
                .filter(p -> p.getName().equals(SamlProtocolConstants.PARAMETER_ENTITY_ID))
                .findFirst();

            if (param.isPresent()) {
                LOGGER.debug("Found entity Id in service id [{}]", param.get().getValue());
                return Optional.of(param.get().getValue());
            }
            val request = WebUtils.getHttpServletRequestFromExternalWebflowContext();
            if (request != null && StringUtils.isNotBlank(request.getQueryString())) {
                val query = request.getQueryString().split("&");
                val paramRequest = Arrays.stream(query)
                    .map(p -> {
                        var params = Splitter.on("=").splitToList(p);
                        return Pair.of(params.get(0), params.get(1));
                    })
                    .filter(p -> p.getKey().equals(SamlProtocolConstants.PARAMETER_ENTITY_ID))
                    .map(Pair::getValue)
                    .map(EncodingUtils::urlDecode)
                    .findFirst();
                LOGGER.debug("Found entity id as part of request url [{}]", paramRequest);
                return paramRequest;
            }
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return Optional.empty();
    }
1258636
protected IEntity primGetEntity(String key, Class type) throws GroupsException {
        return entityFactory.newInstance(key, type);
    }
663509
public Entity getEntityWithKey(String keyName) {
    // [START getEntityWithKey]
    Key key = datastore.newKeyFactory().setKind("MyKind").newKey(keyName);
    Entity entity = datastore.get(key);
    // Do something with the entity
    // [END getEntityWithKey]
    return entity;
  }
1231466
private E getEntity(Object entity)
    {
        return (E) (entity.getClass().isAssignableFrom(EnhanceEntity.class) ? ((EnhanceEntity) entity).getEntity()
                : entity);
    }