23.6.2021

String.formatted


    //since 1.5
    public static String format(String format, Object... args) { ... }
    
    String.format("Not allowed to access %s due to '%s'", entity.getSimpleName(), message) 
   
    //since 15
    public String formatted(Object... args) { ... }

    "Not allowed to access %s due to '%s'".formatted(entity.getSimpleName(), message)
Simon

Softwareentwickler

Zur Übersicht

Standort Hannover

newcubator GmbH
Bödekerstraße 22
30161 Hannover

Standort Dortmund

newcubator GmbH
Westenhellweg 85-89
44137 Dortmund