geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeoPackageMetadataDataSource.java
private List<String> getMetadataWhereNameLike(String like, String sortColumn, boolean notLike) {
        List<String> names = new ArrayList<>();
        StringBuilder where = new StringBuilder(GeoPackageMetadata.COLUMN_NAME);
        if (notLike) {
            where.append(" not");
        }
        where.append(" like ?");
        String[] whereArgs = new String[]{like};
        Cursor cursor = db.query(GeoPackageMetadata.TABLE_NAME, new String[]{GeoPackageMetadata.COLUMN_NAME}, where.toString(), whereArgs, null, null, sortColumn);
        try {
            while (cursor.moveToNext()) {
                names.add(cursor.getString(0));
            }
        } finally {
            cursor.close();
        }
        return names;
    }
private List<String> getMetadataWhereNameLike(String like, String sortColumn, boolean notLike) {
        List<String> names = new ArrayList<>();
        StringBuilder where = new StringBuilder(GeoPackageMetadata.COLUMN_NAME);
        if (notLike) {
            where.append(" not");
        }
        where.append(" like ?");
        String[] whereArgs = new String[]{like};
        Cursor cursor = db.query(GeoPackageMetadata.TABLE_NAME, new String[]{GeoPackageMetadata.COLUMN_NAME}, where.toString(), whereArgs, null, null, sortColumn);
        try {
            while (cursor.moveToNext()) {
                names.add(cursor.getString(0));
            }
        } finally {
            cursor.close();
        }
        return names;
    }
private List < String > getMetadataWhereNameLike ( String like , String sortColumn , boolean notLike ) { List < String > names = new ArrayList <> ( ) ; StringBuilder where = new StringBuilder ( GeoPackageMetadata . COLUMN_NAME ) ; if ( notLike ) { where . append ( " not" ) ; } where . append ( " like ?" ) ; String [ ] whereArgs = new String [ ] { like } ; Cursor cursor = db . query ( GeoPackageMetadata . TABLE_NAME , new String [ ] { GeoPackageMetadata . COLUMN_NAME } , where . toString ( ) , whereArgs , null , null , sortColumn ) ; try { while ( cursor . moveToNext ( ) ) { names . add ( cursor . getString ( 0 ) ) ; } } finally { cursor . close ( ) ; } return names ; }
Get metadata where the name is like or not like

@param like       like or not like argument
@param sortColumn sort by column
@param notLike    true if a not like query
@return metadata names
Get metadata where the name is like or not like