@Override public PropertyKey getKey() { return new PropertyKey("n/a"); }
/** * Creates an instance for the given set and name. * * @param propertySet the name of the set the property belongs to. * @param name the name of the property. * @return the created instance. * @throws IllegalArgumentException if {@code propertySet} is blank but not * <code>null</code> or if {@code name} is blank. */ public static PropertyKey create(final String propertySet, final String name) throws IllegalArgumentException { return new PropertyKey(propertySet, name); }
/** * Creates an instance for the given qualified name. * * @param qualifiedName a name optionally prefixed with a property set name * separated by the last occurrence (excluding the very end) of the * {@code separator}. * @param separator the separator to use if for some reason the default is not * appropriate. * @return the created instance. * @throws BlankArgumentException if {@code qualifiedName} is blank. */ public static PropertyKey create(final String qualifiedName, final char separator) throws BlankArgumentException { Arg.checkNotBlank("qualifiedName", qualifiedName); final int dotIndex = qualifiedName.lastIndexOf(separator); if (dotIndex > 0 && dotIndex < qualifiedName.length() - 1) { final String propertySetName = qualifiedName.substring(0, dotIndex); final String name = qualifiedName.substring(dotIndex + 1); return new PropertyKey(propertySetName, name); } else { return new PropertyKey(null, qualifiedName); } }