All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.cedarsoft.devtools.MavenMessageHandler Maven / Gradle / Ivy

The newest version!
package eu.cedarsoft.devtools;

import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;

import java.text.MessageFormat;
import java.util.ResourceBundle;

/**
 * Message handler for maven related messages
 */
public class MavenMessageHandler {
  @NotNull
  @NonNls
  private static final String RESOURCE_BUNDLE_NAME_MAVEN = "maven";
  private static final ResourceBundle BUNDLE = ResourceBundle.getBundle( RESOURCE_BUNDLE_NAME_MAVEN );

  private MavenMessageHandler() {
  }

  @NotNull
  public static String get( @NonNls @PropertyKey( resourceBundle = RESOURCE_BUNDLE_NAME_MAVEN ) @NotNull String key ) {
    return BUNDLE.getString( key );
  }

  @SuppressWarnings( {"OverloadedVarargsMethod"} )
  public static String get( @NonNls @PropertyKey( resourceBundle = RESOURCE_BUNDLE_NAME_MAVEN ) @NotNull String key, Object... arguments ) {
    return MessageFormat.format( BUNDLE.getString( key ), arguments );
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy