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

com.codepulsar.nils.api.Formats Maven / Gradle / Ivy

Go to download

The core NILS library - A Java NLS library (aka national language support, localisation, internationalisation, i18n, l10n).

The newest version!
package com.codepulsar.nils.api;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.time.format.DateTimeFormatter;

/**
 * A Formats provides access to divers Java related formatter object.
 *
 * 

All are related to the Locale used in a {@link NLS} object. * *

A Formats can be retrieved by calling {@link NLS#getFormats()}. */ public interface Formats { /** * Get a DateTimeFormatter object for "temporal" dates like LocalDate in * the FormatStyle defined in {@link NilsConfig#getDateFormatStyle()}. * * @return A DateTimeFormatter object for date. */ DateTimeFormatter forDate(); /** * Get a DateTimeFormatter object for "temporal" times like LocalTime in * the FormatStyle defined in {@link NilsConfig#getDateFormatStyle()}. * *

Note: Only FormatStyle.MEDIUM and FormatStyle.SHORT can be * used for LocalTime object. Any other configuration of {@link NilsConfig#getDateFormatStyle()} * will result in FormatStyle.MEDIUM. * * @return A DateTimeFormatter object for time. */ DateTimeFormatter forTime(); /** * Get a DateTimeFormatter object for "temporal" dates with time like * LocalDateTime in the FormatStyle defined in {@link NilsConfig#getDateFormatStyle()}. * * @return A DateTimeFormatter object for date with time. */ DateTimeFormatter forDateTime(); /** * Get a DateFormat object for "util" Dates with date information in the * FormatStyle defined in {@link NilsConfig#getDateFormatStyle()}. * * @return A DateFormat object for date. */ DateFormat forUtilDate(); /** * Get a DateFormat object for "util" Dates with time information in the * FormatStyle defined in {@link NilsConfig#getDateFormatStyle()}. * * @return A DateFormat object for time. */ DateFormat forUtilTime(); /** * Get a DateFormat object for "util" Date with date and time * information in the FormatStyle defined in {@link NilsConfig#getDateFormatStyle()}. * * @return A DateFormat object for date with time. */ DateFormat forUtilDateTime(); /** * Get a NumberFormat object for Numbers. * * @return A NumberFormat object. */ NumberFormat forNumber(); /** * Get a NumberFormat object for formatting Numbers as currencies. * * @return A NumberFormat object. */ NumberFormat forCurrency(); /** * Get a NumberFormat object for formatting Numbers as integer. * * @return A NumberFormat object. */ NumberFormat forInteger(); /** * Get a NumberFormat object for formatting Numbers as percent values. * * @return A NumberFormat object. */ NumberFormat forPercent(); /** * Get a DecimalFormat object for formatting Numbers as decimal values. * * @return A DecimalFormat object. */ DecimalFormat forDecimal(); /** * Get a DecimalFormatSymbols object. * * @return A DecimalFormatSymbols object. */ DecimalFormatSymbols decimalFormatSymbols(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy