Returns the name and falls back to the item name.
@param item  The item.
@param name  The name to check.
@param <T>
@return
979938
private static <T> String name(T item, String name) {
    if (name != null && !name.isEmpty()) {
      return name;
    } else if (item instanceof HasMetadata) {
      HasMetadata h = (HasMetadata) item;
      return h.getMetadata() != null ? h.getMetadata().getName() : null;
    }
    return null;
  }
929788
@Override
    public int getItemType(BaseCell item) {
        // if the item is a keyType, which means item.type is not the key
        int version = mViewManager != null ? mViewManager.getViewVersion(item.stringType) : 0;
        if (!TextUtils.isEmpty(item.typeKey)) {
            // we should use getTypeKey()
            String typeKey = item.typeKey + version;
            if (!mStrKeys.containsKey(typeKey)) {
                int newType = mTypeId.getAndIncrement();
                mStrKeys.put(typeKey, newType);
                mId2Types.put(newType, item.stringType);
            }

            return mStrKeys.get(typeKey).intValue();
        } else {
            // otherwise, use item.type as identity key
            // note, this now only be executed in MainThread, atomic not actually needed
            String stringType = item.stringType + version;
            if (!mStrKeys.containsKey(stringType)) {
                int newType = mTypeId.getAndIncrement();
                mStrKeys.put(stringType, newType);
                mId2Types.put(newType, item.stringType);
            }
            return mStrKeys.get(stringType).intValue();
        }
    }
304797
private <T> T getItem(String itemName, Map<String, T> items, String typeName) {
		T item = items.get(itemName);
		if (item == null) {
			throw new FuzzerException(name + ": " + typeName + " '" + itemName + "' not found");
		}
		return item;
	}
523665
@SuppressWarnings("unchecked")
    public <T> MenuState<T> getMenuState(MenuItem<T> item) {
        return (MenuState<T>) menuStates.get(item.getId());
    }
690697
public String provideUsername(Item item) {
        return isUsingCredentialsPlugin() ? PluginsUtils.credentialsLookup(credentialsId, item).getUsername() :  credentials.getUsername();
    }
296902
private static String getTopVarName(String name) {
    int firstDotIndex = name.indexOf('.');
    return firstDotIndex == -1 ? name : name.substring(0, firstDotIndex);
  }
1217965
function (item) {
            if($.isEmptyObject(item)){
              var tempObj={ id: $('input:first', el).val(), name: $('input:first', el).val()};
              return [tempObj];
            }else{
              return item;
            }
          }
216352
public static Item toItem(Map<String, AttributeValue> item) {
        if (item == null) {
            return null;
        }
        return Item.fromMap(toSimpleMapValue(item));
    }
957044
public @NotNull <T> T get(@NotNull String name, @NotNull T defaultValue) {
    @Nullable
    @SuppressWarnings("unchecked")
    T value = get(name, (Class<T>)defaultValue.getClass());
    if (value != null) {
      return value;
    }
    else {
      return defaultValue;
    }
  }
544669
public T get(String name) {
        if (m_items == null) {
            return null;
        }
        return m_items.get(name.toUpperCase());
    }
785201
@Override public TopLevelItem getItem(String name) throws AccessDeniedException {
        if (name==null)    return null;
        TopLevelItem item = items.get(name);
        if (item==null)
            return null;
        if (!item.hasPermission(Item.READ)) {
            if (item.hasPermission(Item.DISCOVER)) {
                throw new AccessDeniedException("Please login to access job " + name);
            }
            return null;
        }
        return item;
    }
1338840
def get_item_name(self, item, parent):
        
        names = self.get_name_elements(item)
        if not names:
            raise MissingNameElementError

        name = names[0].text
        prefix = self.item_name_prefix(parent)
        if prefix:
            name = prefix + name

        return name
341685
@Override
    public ItemProcessor getProcessor(Item item) {
        for (Map.Entry<String, ItemProcessor> mapping : patternToProcessorMappings.entrySet()) {
            if (item.getUrl().matches(mapping.getKey())) {
                return mapping.getValue();
            }
        }

        return null;
    }
215318
public String getItem(String itemName, String suffix) {
        return items.get(lookupItemName(itemName, suffix, false));
    }
155044
@SuppressWarnings("unchecked")
  public <T extends Value<?>> List<T> getList(String name) {
    return (List<T>) getValue(name).get();
  }
58859
public boolean containsName(final String name) {
        for (final T i : this) {
            if (i.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }
1014393
private static String getFullNameForItem(@Nullable BlueOrganization org, @Nonnull Item item) {
        ItemGroup<?> group = getBaseGroup(org);
        return Functions.getRelativeNameFrom(item, group);
    }