Get a set of properties those share the same given name prefix.

@param propertyNamePrefix
prefix of name
@return the set of values whose property names share the same prefix
184364
public static Set<String> getPropertiesByPrefix(final String propertyNamePrefix) {

        Set<String> ret = new TreeSet<String>();
        Set<Object> keys = properties.keySet();
        for (Object key : keys) {
            if (null != key && key.toString().startsWith(propertyNamePrefix)) {
                ret.add(properties.getProperty(key.toString()));
            }
        }

        return ret;
    }
363332
public static Key<String> getPropertyKey(String propertyName) {
        return Key.get(String.class, Names.named(propertyName));
    }
1202256
public Iterator<String> getPrefixes(String namespaceURI)
   {
      List<String> list = new ArrayList<String>();
      list.add(getPrefix(namespaceURI));
      return list.iterator();
   }
422603
@Override
  public String getPrefix(String namespaceURI) {
    // per javax.xml.namespace.NamespaceContext doc
    if (namespaceURI == null)
      throw new IllegalArgumentException("Cannot find prefix for null namespace URI");
    if (XMLConstants.XML_NS_URI.equals(namespaceURI))
      return XMLConstants.XML_NS_PREFIX;
    if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
      return XMLConstants.XMLNS_ATTRIBUTE;

    for (Map.Entry<String, String> entry: bindings.entrySet()) {
      if (namespaceURI.equals(entry.getValue()))
        return entry.getKey();
    }

    return null;
  }
474617
public static Predicate<Class<?>> inPackage(final String packageNamePrefix) {
        return clazz -> clazz.getPackage().getName().startsWith(packageNamePrefix);
    }
1263796
@SuppressWarnings("unchecked")
    public final <C extends T> PropertyList<C> getProperties(final String name) {
        final PropertyList<C> list = new PropertyList<C>();
        for (final T p : this) {
            if (p.getName().equalsIgnoreCase(name)) {
                list.add((C) p);
            }
        }
        return list;
    }
288610
protected static Properties getComponentProperties(String componentPrefix, Properties properties) {
        Properties result = new Properties();
        if (null != componentPrefix) {
            int componentPrefixLength = componentPrefix.length();
            for (String propertyName : properties.stringPropertyNames()) {
                if (propertyName.startsWith(componentPrefix)) {
                    result.put(propertyName.substring(componentPrefixLength), properties.getProperty(propertyName));
                }
            }
        }
        return result;
    }
1052286
private Map<String, String> getConfigMapFromProperties(String prefix) {
        Map<String, String> rval = new HashMap<>();
        getKeys(prefix).forEach(pair -> {
            if (!pair.getKey().equals(prefix)) {
                String shortKey = pair.getKey().substring(prefix.length() + 1);
                rval.put(shortKey, pair.getValue());
            }
        });
        return rval;
    }
117338
protected synchronized PrefixedProperties createProperties() {
		if (myProperties == null) {
			PrefixedProperties resultProperties = null;
			String environment = defaultPrefix;
			if (environmentFactory != null) {
				environment = environmentFactory.getEnvironment();
			} else if (defaultPrefixSystemPropertyKey != null) {
				environment = System.getProperty(defaultPrefixSystemPropertyKey);
				if (environment == null) {
					if (logger.isWarnEnabled()) {
						logger.warn(String.format("Didn't found system property key to set default prefix: %1s",
								defaultPrefixSystemPropertyKey));
					}
				}
			}
			if (prefixConfigList != null) {
				resultProperties = PrefixedProperties.createCascadingPrefixProperties(prefixConfigList);
			} else {
				if (environment != null) {
					resultProperties = PrefixedProperties.createCascadingPrefixProperties(environment);
				} else {
					resultProperties = new PrefixedProperties();
				}
			}
			resultProperties.setDefaultPrefix(environment);
			if (logger.isInfoEnabled()) {
				logger.info(String.format("Setting default prefix to: %1s", environment));
			}
			resultProperties.setMixDefaultAndLocalPrefixSettings(mixDefaultAndLocalPrefixConfigurations);
			myProperties = resultProperties;
		}
		return myProperties;
	}
1243023
public synchronized String getNamespaceURIByPrefix(String prefix) throws NamespaceException
   {
      if (!prefixToURI.containsKey(prefix))
      {
         throw new NamespaceException(prefix + ": is not a registered namespace prefix.");
      }
      return prefixToURI.get(prefix);
   }
354559
public static String removePropertyPrefix(String propertyValue) {

        if (propertyValue == null) {
            return null;
        }
        if (propertyValue.startsWith(DYNAMIC_TEMPLATE_PREFIX)) {
            return propertyValue.substring(DYNAMIC_TEMPLATE_PREFIX.length());
        }
        if (propertyValue.startsWith(DYNAMIC_TEMPLATE_LEGACY_PREFIX)) {
            return propertyValue.substring(DYNAMIC_TEMPLATE_LEGACY_PREFIX.length());
        }
        return propertyValue;
    }
1319788
@Override
	public final Enumeration<String> getPropertyNames()
    {
    	assertDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
    	
    	if (propertyMap == null)
    		return new EmptyEnumeration<>();
    		
        return new IteratorEnumeration<>(propertyMap.keySet().iterator());
    }
1104418
public static Collection<String> getPropertyNames(Channel channel) {
		Collection<String> propertyNames = new HashSet<String>();
		for (Property property : channel.getProperties()) {
			if (property.getValue() != null)
				propertyNames.add(property.getName());
		}
		return propertyNames;
	}
710040
public RawProperty getExperimentalProperty(String name) {
		for (RawProperty raw : getExperimentalProperties()) {
			if (raw.getName().equalsIgnoreCase(name)) {
				return raw;
			}
		}
		return null;
	}
538790
protected String getParentPropertyName(String propertyName) {
		if (!PropertyAccessorUtils.isIndexedProperty(propertyName)) {
			return "";
		}
		else {
			return propertyName.substring(0, propertyName.lastIndexOf(PROPERTY_KEY_PREFIX_CHAR));
		}
	}
70042
@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public PrefixedPropertiesEnumeration<?> propertyNames() {
		lock.readLock().lock();
		try {
			final Set result = new HashSet();
			for (final Object key : getKeyMap(false).keySet()) {
				result.add(getUnprefixedKey(key));
			}
			return new PrefixedPropertiesEnumerationImpl(result.iterator(), true);
		} finally {
			lock.readLock().unlock();
		}
	}
1240636
@SuppressWarnings("unchecked")
  protected Set<String> getKeys(String prefix)
  {

    Set<String> result = new HashSet<String>();

    @SuppressWarnings("rawtypes")
    final Set keys = new HashSet();
    keys.addAll(session.getUserProperties().keySet());
    keys.addAll(project.getProperties().keySet());

    if (prefix == null) return keys;

    for (Object key : keys) {
      if (((String) key).startsWith(prefix))
        result.add((String) key);
    }

    return result;
  }