@Test public void findPropertyKeys_EmptyIterator_WhenEmptyConfig() { assertFalse( cfg.findPropertyKeys( "" ).hasNext() ); }
public Iterator<String> findPropertyKeys( final String prefix ) { String[] array = new String[ size() ]; int found = 0; Enumeration enum1 = keys(); while ( enum1.hasMoreElements() ) { String key = (String) enum1.nextElement(); if ( key.startsWith( prefix ) ) { array[ found ] = key; found++; } } if ( found == 0 ) { return Collections.emptyIterator(); } else if ( found == 1 ) { return Collections.singleton( array[ 0 ] ).iterator(); } else { String[] returned = new String[ found ]; System.arraycopy( array, 0, returned, 0, found ); Arrays.sort( returned ); return Arrays.asList( returned ).iterator(); } }
DefaultConfiguration extends Properties implements ModifiableConfiguration { public Iterator<String> findPropertyKeys( final String prefix ) { String[] array = new String[ size() ]; int found = 0; Enumeration enum1 = keys(); while ( enum1.hasMoreElements() ) { String key = (String) enum1.nextElement(); if ( key.startsWith( prefix ) ) { array[ found ] = key; found++; } } if ( found == 0 ) { return Collections.emptyIterator(); } else if ( found == 1 ) { return Collections.singleton( array[ 0 ] ).iterator(); } else { String[] returned = new String[ found ]; System.arraycopy( array, 0, returned, 0, found ); Arrays.sort( returned ); return Arrays.asList( returned ).iterator(); } } }
DefaultConfiguration extends Properties implements ModifiableConfiguration { public Iterator<String> findPropertyKeys( final String prefix ) { String[] array = new String[ size() ]; int found = 0; Enumeration enum1 = keys(); while ( enum1.hasMoreElements() ) { String key = (String) enum1.nextElement(); if ( key.startsWith( prefix ) ) { array[ found ] = key; found++; } } if ( found == 0 ) { return Collections.emptyIterator(); } else if ( found == 1 ) { return Collections.singleton( array[ 0 ] ).iterator(); } else { String[] returned = new String[ found ]; System.arraycopy( array, 0, returned, 0, found ); Arrays.sort( returned ); return Arrays.asList( returned ).iterator(); } } DefaultConfiguration(); }
DefaultConfiguration extends Properties implements ModifiableConfiguration { public Iterator<String> findPropertyKeys( final String prefix ) { String[] array = new String[ size() ]; int found = 0; Enumeration enum1 = keys(); while ( enum1.hasMoreElements() ) { String key = (String) enum1.nextElement(); if ( key.startsWith( prefix ) ) { array[ found ] = key; found++; } } if ( found == 0 ) { return Collections.emptyIterator(); } else if ( found == 1 ) { return Collections.singleton( array[ 0 ] ).iterator(); } else { String[] returned = new String[ found ]; System.arraycopy( array, 0, returned, 0, found ); Arrays.sort( returned ); return Arrays.asList( returned ).iterator(); } } DefaultConfiguration(); String getConfigProperty( final String key ); String getConfigProperty( final String key, final String defaultValue ); Iterator<String> findPropertyKeys( final String prefix ); Enumeration<String> getConfigProperties(); void setConfigProperty( final String key, final String value ); }
DefaultConfiguration extends Properties implements ModifiableConfiguration { public Iterator<String> findPropertyKeys( final String prefix ) { String[] array = new String[ size() ]; int found = 0; Enumeration enum1 = keys(); while ( enum1.hasMoreElements() ) { String key = (String) enum1.nextElement(); if ( key.startsWith( prefix ) ) { array[ found ] = key; found++; } } if ( found == 0 ) { return Collections.emptyIterator(); } else if ( found == 1 ) { return Collections.singleton( array[ 0 ] ).iterator(); } else { String[] returned = new String[ found ]; System.arraycopy( array, 0, returned, 0, found ); Arrays.sort( returned ); return Arrays.asList( returned ).iterator(); } } DefaultConfiguration(); String getConfigProperty( final String key ); String getConfigProperty( final String key, final String defaultValue ); Iterator<String> findPropertyKeys( final String prefix ); Enumeration<String> getConfigProperties(); void setConfigProperty( final String key, final String value );  }