Parses an item id

@param id
the identifier of the entity, such as "Q42"
@param siteIri
the siteIRI that this value refers to
@throws IllegalArgumentException
if the id is invalid
7556
static EntityIdValue fromId(String id, String siteIri) {
		switch (guessEntityTypeFromId(id)) {
			case EntityIdValueImpl.JSON_ENTITY_TYPE_ITEM:
				return new ItemIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_PROPERTY:
				return new PropertyIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_LEXEME:
				return new LexemeIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_FORM:
				return new FormIdValueImpl(id, siteIri);
			case EntityIdValueImpl.JSON_ENTITY_TYPE_SENSE:
				return new SenseIdValueImpl(id, siteIri);
			default:
				throw new IllegalArgumentException("Entity id \"" + id + "\" is not supported.");
		}
	}
1157159
protected final String computeId(
            final ITemplateContext context,
            final IProcessableElementTag tag,
            final String name, final boolean sequence) {

        String id = tag.getAttributeValue(this.idAttributeDefinition.getAttributeName());
        if (!org.thymeleaf.util.StringUtils.isEmptyOrWhitespace(id)) {
            return (StringUtils.hasText(id) ? id : null);
        }

        id = FieldUtils.idFromName(name);
        if (sequence) {
            final Integer count = context.getIdentifierSequences().getAndIncrementIDSeq(id);
            return id + count.toString();
        }
        return id;

    }
6460
public static Integer parseItemLayoutId(Class<? extends ItemViewHolder> itemViewHolderClass) {
        Integer itemLayoutId = ClassAnnotationParser.getLayoutId(itemViewHolderClass);
        if (itemLayoutId == null) {
            throw new LayoutIdMissingException();
        }
        return itemLayoutId;
    }
777459
function f_sehir_id(_id) {
        if (!_id) {
            return null;
        }
        return Array.isArray(_id)
            ? result.dbQ.hmget_json_parse(result.kp.sehir.tablo, _id)
            : result.dbQ.hget_json_parse(result.kp.sehir.tablo, _id);
    }
816294
public static String urlEncodeId(String id) throws InvalidRequestException {
    try {
      return urlEncode(id);
    } catch (UnsupportedEncodingException e) {
      throw new InvalidRequestException(String.format(
          "Unable to encode `%s` in the url to %s. "
          + "Please contact support@stripe.com for assistance.", id, CHARSET),
          null, null, null, 0, e);
    }
  }
1144165
public final void setId(final ID id) {
    Assert.notNull(id, "The identifier for Rule ({0}) cannot be null!", getClass().getName());
    this.id = id;
  }
1106355
def parse_id(input_id):
    
    key_value = input_id.split(':')

    if len(key_value) != 2:
        raise exceptions.CLIAbort(
            'Invalid ID %s: ID should be of the form xxx:yyy' % input_id)
    return key_value[0], int(key_value[1])
459975
protected RelationKey parseRelationKey(String id) {

        Matcher matcher = RELATION_PATTERN.matcher(id);
        matcher.find();
        CmsUUID src = new CmsUUID(matcher.group(1));
        CmsUUID tgt = new CmsUUID(matcher.group(2));
        String tp = matcher.group(3);
        return new RelationKey(src, tgt, tp);
    }
1097407
public static String resourceTypeFromResourceId(String id) {
        return (id != null) ? ResourceId.fromString(id).resourceType() : null;
    }
110226
public int getItemPosition(int id) {
        for(int index = getCount()-1; index >= 0; index--) {
            TwinTextItem item = getItem(index);
            if(item.getId() == id)
                return index;
        }
        return -1;
    }
893030
public void setId(String id) {
        logger.entering(id);
        this.id = id;
        logger.exiting();
    }
9999
protected Person getPersonById(String id) {
		Person person = null;
		try {
			Long personId = Long.valueOf(id);
			if (logger.isDebugEnabled()) {
				logger.debug("Retrieving Person with id=[{}]", personId);
			}
			person = entityManager.find(Person.class, personId);
		} catch (NumberFormatException e) {
			if (logger.isWarnEnabled()) {
				logger.warn("Invalid number format: {}", id);
			}
		}
		if (person == null) {
			throw new IllegalArgumentException();
		}
		return person;
	}
251664
private boolean isValidUuid(final String id) {

		if (id != null) {

			if (id.length() != 32) {
				return false;
			}

			return UUID_PATTERN.matcher(id).matches();
		}

		return false;
	}
127945
@SuppressWarnings("unchecked")
	@Override
	public ID getId(T entity) {
		return (ID) MetadataParser.getItemName(entity);
	}
274715
void parse(QEntityFactory entityFactory, EntityType<?> metadata, SessionFactoryImplementor sessionFactory)
	{
		this.metamodelEntity = metadata;
		this.name = metadata.getName();

		for (Attribute<?, ?> attribute : metadata.getAttributes())
		{
			parseFields(entityFactory, sessionFactory, null, attribute);
		}

		// Parse top-level properties

		// Add identifier property
		{
			if (!metadata.hasSingleIdAttribute())
				throw new IllegalArgumentException("@IdClass Entity not supported! " + metadata.getJavaType());

			Type idType = metadata.getIdType();

			switch (idType.getPersistenceType())
			{
				case BASIC:
					break; // No action necessary, will be processed like a normal field
				case EMBEDDABLE:
				{
					EmbeddableType<?> emb = (EmbeddableType<?>) idType;

					parseEmbeddable(entityFactory, sessionFactory, "id", emb);
					break;
				}
				default:
					throw new IllegalArgumentException("Cannot handle id type: " + idType.getPersistenceType() + ": " + idType);
			}
		}

		// Add links to descendants
		{
			final List<QEntity> descendants = entityFactory.getSubclasses(clazz);

			if (!descendants.isEmpty())
				this.descendants = descendants;
		}


		// Figure out the id method/field
		final String idPropertyName = getIdPropertyName();

		if (idPropertyName != null)
			this.idProperty = new PropertyWrapper(clazz, idPropertyName);
	}
583741
protected void setId(String id) {
		if (!StringUtils.hasText(id)) {
			id = null;
		}
		this.id = id;
	}
329616
private static void validateId(String id) {

        if (id == null) {
            return;
        }
        int n = id.length();
        if (n < 1) {
            throw new IllegalArgumentException("Empty id attribute is not allowed");
        }
        for (int i = 0; i < n; i++) {
            char c = id.charAt(i);
            if (i == 0) {
                if (!Character.isLetter(c) && (c != '_')) {
                    throw new IllegalArgumentException(id);
                }
            } else {
                if (!Character.isLetter(c) &&
                        !Character.isDigit(c) &&
                        (c != '-') && (c != '_')) {
                    throw new IllegalArgumentException(id);
                }
            }
        }

    }