Releases: google/mug
Releases · google/mug
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:
Chain
an 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.Fanout
for easy structured concurrency.
Guava Addons
Release 8.0
Release 8.0
DateTimeFormats.parseToInstant()
,parseZonedDateTime()
StructuredConcurrency
@TemplateFormatMethod
and compile-time checks
Release 7.2
Substring.replaceAllFrom()
.- Support up to 8 lambda args in Substring.
Release 7.1
- DateTimeFormats creates
DateTimeFormatter
from example date time strings. - PrefixSearchTable
- ParameterizedQuery is a BigQuery client template that guards against SQL injection
Release 7.0
StringFormat
template supportSafeQuery
andGoogleSql
for injection-safe SQL- ErrorProne (
mug-errorprone
) checks to provide compile-time safety forStringFormat
parsing, formatting and templating. - Bazel build integration
Thanks to xingyutangyuan for the contribution to the ErrorProne plugin and Bazel integration!
Release 6.6
StringFormat
- parsing structured data from strings.MoreCollectors.combining()
to combine elements of a short stream with lambdas.
Release 6.5
Parallelizer.inParallel()
collector (for parallel IO)partitioningBy()
collectorgroupingByEach()
collectorBiStream.min()
BiStream.max()
Release 6.4
- Generic BinarySearch algorithm (beyond sorted arrays and lists)
- MoreIterables
Release 6.3
- Substring look-around (
immediatelyBetween()
,followedBy()
,precededBy()
) - Substring negative look-around (
notImmediatelyBetween()
,notFollowedBy()
,notPredededBy()
)