Releases: google/mug
Releases · google/mug
Release 9.3
- Dot Parse.
- Easy, safe parser combinator library (no infinite loop possible).
- Supports lazy, streaming parsing (
jsonParser.parseToStream(Reader)). Csvand regex parsers included.- Tiny — 1/5 the size of jparsec.
- New
StringFormat.format()overloads for more efficient formatting.
Release 9.2
SafeSql.queryForOne().- Supports public fields besides Java Beans.
{names? -> AND name IN (names?)}BoundedConcurrencyin mug-concurrent24.concurrently()as a higher-throughputmapConcurrent().race().
Release 9.1
- Automatic module names
- Fixed accidental JDK 9 references
Release 9.0
Major release fixing dependencies.
SafeSqlsupports converting ResultSet into Java Beans and records.- Removed guava dependency from the
mug-safesqlartifact to help avoid jar hell. - Added
mug-spannerartifact withParameterizedQueryto offer safe templating for Cloud Spanner dynamic queries (no extra dependency other than mug and cloud spanner). - Fixed
mug-guavasplit package by renaming packages to make it more friendly to JPMS - Moved CaseBreaker into Mug core artifact.
- Split out the CaseFormat-dependent method into mug-guava as
CaseFormatsclass. - Added optional template parameter support. For example:
SafeSql.of("... {filter? -> WHERE filter?}", optionalFilter())
mug-root-8.7
Release 8.7:
SafeSqlsupportsquery(connection, Class)to query intoList<T>.Substring.consecutive(char)
Release 8.6
Substring.all()e.g.all(',').split(line)SafeSqlusesESCAPE '^'forLIKEescaping
Release 8.5
{condition -> subquery}support forSafeQueryandSafeSql.SafeSql.queryLazily()that returns Stream
Release 8.3
Simplified structured concurrency Fanout API:
concurrently()cancellable.withMaxConcurrency(maxConcurrency).inParallel(...)cancellable.concurrently()throws unchecked exception so is easy to use in Stream.
Release 8.2
Mug Core
- Substring.RepeatingPattern supports matching from the middle of a string:
word().repeatedly().match(input, fromIndex)
Mug Guava
SafeSql- an injection-safe dynamic SQL template for JDBC. User-friendly API supporting powerful yet intuitive dynamic SQL composition and parameterization:SafeSql usersByName(String who, @CompileTimeConstant List<String> columns) { return SafeSql.of("SELECT `{columns}` FROM Users WHERE name LIKE '%{who}%'", columns, who); } try (var connection = DriverManager.getConnection(...)) { // SELECT `id`, `name` FROM Users WHERE name LIKE '%Emma%' List<User> users = usersByName("Emma", asList("id", "name")) .query(connection, row -> new User(row.getLong("id"), row.getString("name"))); ... }
Release 8.1
Core:
Chainan immutable, efficient, scalable, concatenatableList.BiCollectors.partitioningBy()MoreCollectors.collectingAndThen()to be used together withpartitioningBy(). For example:collectingAndThen( partitioningBy(Person::isGood), (good, evil) -> ...)
BiCollectors.collectingAndThen()BiCollectors.inverse()Optionals.inOrder()to help reducing nesting.Fanoutfor easy structured concurrency.