Lookup a prepared string in the dictionary.

<p>If id is non-null, then consider only strings with different ids (or null ids).
770395
public Object lookup(String id,StringWrapper toFind)
    {
	doLookup(id,toFind);
	return closestMatch;
    }
642002
public <P extends ParaObject> P findById(String id) {
		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
		params.putSingle(Config._ID, id);
		List<P> list = getItems(find("id", params));
		return list.isEmpty() ? null : list.get(0);
	}
387626
public E getById(String id) {
        if (id == null) {
            for (E element : this) {
                if (element != null && element.getId() == null) {
                    return element;
                }
            }
        } else {
            for (E element : this) {
                if (element != null && id.equals(element.getId())) {
                    return element;
                }
            }
        }
        return null;
    }
107782
@Override
    public Object lookup(String s) throws NamingException {
        if (s == null)
            throw new InvalidNameException();
        //turn the String into a CompositeName and then use the Name form of the method
        //all necessary parsing etc will be done there
        return lookup(newCompositeName(s));
    }
1177584
public static String id(String name, ClassDefinition appender, Map<String, String> appenderArgs, ClassDefinition layout, Map<String, String> layoutArgs, int level,
	    boolean readOnly) {
	StringBuilder sb = new StringBuilder(name).append(';').append(appender).append(';');
	toString(sb, appenderArgs);
	sb.append(';').append(layout).append(';');
	toString(sb, layoutArgs);
	sb.append(';').append(level).append(';').append(readOnly);

	return HashUtil.create64BitHashAsString(sb.toString(), Character.MAX_RADIX);
    }
180867
public void put(String id,String string,Object value)
    {
	if (DEBUG && id!=null) System.out.println(id+":"+string+" => "+value);
	put(id, new MyWrapper(string), value);
    }
1252057
private static Element lookupId(List<Element> fields) {
		Element objectIdField = null;
		Element uuidField = null;
		Element _idField = null;
		Element idField = null;
		for (Element field : fields) {
			if (field.getAnnotation(Id.class) != null) {
				return field;
			}
			if (isObjectId(field)) {
				objectIdField = field;
			}
			else if (isUUID(field)) {
				uuidField = field;
			}
			else if (field.getSimpleName().contentEquals(ID_FIELD_NAME)) {
				_idField = field;
			}
			else if (field.getSimpleName().contentEquals("id")) {
				idField = field;
			}
		}

		if (objectIdField != null) {
			return objectIdField;
		}
		if (uuidField != null) {
			return uuidField;
		}
		if (_idField != null) {
			return _idField;
		}
		if (idField != null) {
			return idField;
		}

		return null;
	}
1048362
static String toStringIdOrIndex(Context cx, Object id)
    {
        if (id instanceof Number) {
            double d = ((Number)id).doubleValue();
            int index = (int)d;
            if (index == d) {
                storeIndexResult(cx, index);
                return null;
            }
            return toString(id);
        }
        String s;
        if (id instanceof String) {
            s = (String)id;
        } else {
            s = toString(id);
        }
        long indexTest = indexFromString(s);
        if (indexTest >= 0) {
            storeIndexResult(cx, (int)indexTest);
            return null;
        }
        return s;
    }
733945
def normalize_id(string):
    
    if not isinstance(string, basestring):
        fail("Type of argument must be string, found '{}'"
             .format(type(string)))
    # get the id nomalizer utility
    normalizer = getUtility(IIDNormalizer).normalize
    return normalizer(string)
583741
protected void setId(String id) {
		if (!StringUtils.hasText(id)) {
			id = null;
		}
		this.id = id;
	}
822140
public boolean tryGetIdFromInstance(Object entity, Reference<String> idHolder) {
        if (entity == null) {
            throw new IllegalArgumentException("Entity cannot be null");
        }
        try {
            Field identityProperty = getIdentityProperty(entity.getClass());
            if (identityProperty != null) {
                Object value = FieldUtils.readField(identityProperty, entity, true);
                if (value instanceof String) {
                    idHolder.value = (String)value;
                    return true;
                }
            }
            idHolder.value = null;
            return false;
        } catch (IllegalAccessException e) {
            throw new IllegalStateException(e);
        }
    }
109736
def register_id(self, id_string):
        
        try:
            prefix, count = id_string.rsplit("_", 1)
            count = int(count)
        except ValueError:
            # We don't need to worry about ids that don't match our pattern
            pass
        else:
            if prefix == self.prefix:
                self.counter = max(count, self.counter)
165677
public static String getIdString(Object object) {
		if (object == null) {
			throw new NullPointerException();
		}
		return String.valueOf(getId(object));
	}
370524
@Override
	public int lookupIndex(String str) {
		int ret = data.get(str);
		if (ret ==-1 && !frozen)	{
			ret = index.size();
			data.put(str, ret);
			index.put(ret, str);
		}
		return ret;
	}
536026
def prepare_check(data):
    
    if not data:
        return None, {}

    if isinstance(data, str):
        return data, {}

    result = {}
    if "ID" in data:
        result["CheckID"] = data["ID"]
    for k in ("Node", "CheckID", "Name", "Notes", "Status", "ServiceID"):
        if k in data:
            result[k] = data[k]
    if list(result) == ["CheckID"]:
        return result["CheckID"], {}
    return result.get("CheckID"), result
735148
@SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
  private <T> T fetch(final String id) {
    checkNotNull(id);
    checkArgument(!id.isEmpty());
    final T ret = (T) idMap.get(id);
    if (ret == null) {
      throw new EREException(String.format("Lookup failed for id %s.", id));
    }
    return ret;
  }
1211094
protected void checkIdRefs()
        throws XMLStreamException
    {
        /* 02-Oct-2004, TSa: Now we can also check that all id references
         *    pointed to ids that actually are defined
         */
        if (mIdMap != null) {
            ElementId ref = mIdMap.getFirstUndefined();
            if (ref != null) { // problem!
                reportValidationProblem("Undefined id '"+ref.getId()
                                        +"': referenced from element <"
                                        +ref.getElemName()+">, attribute '"
                                        +ref.getAttrName()+"'",
                                        ref.getLocation());
            }
        }
    }