Class SolrValueFormatUtils


  • public final class SolrValueFormatUtils
    extends java.lang.Object
    Provides methods for Solr value formatting.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String value, java.lang.Class<?> valueClass)
      Format a value according to the given value class.
      static java.lang.String formatBigDecimal​(java.lang.String value)
      Formats the value using BigDecimal as value type.
      static java.lang.String formatBigInteger​(java.lang.String value)
      Formats the value using BigInteger as value type.
      static java.lang.String formatBoolean​(java.lang.String value)
      Formats the value using Boolean as value type.
      static java.lang.String formatDate​(java.lang.String value)
      Formats the value using Date as value type.
      static java.lang.String formatDouble​(java.lang.String value)
      Formats the value using Double as value type.
      static java.lang.String formatFloat​(java.lang.String value)
      Formats the value using Float as value type.
      static java.lang.String formatInteger​(java.lang.String value)
      Formats the value using Integer as value type.
      static java.lang.String formatLong​(java.lang.String value)
      Formats the value using Long as value type.
      static java.lang.String formatShort​(java.lang.String value)
      Formats the value using Short as value type.
      static java.lang.String formatString​(java.lang.String value)
      Formats the value using String as value type.
      protected static java.lang.String generateKey​(java.lang.Class<?> valueClass)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • generateKey

        protected static java.lang.String generateKey​(java.lang.Class<?> valueClass)
      • format

        public static java.lang.String format​(java.lang.String value,
                                              java.lang.Class<?> valueClass)
        Format a value according to the given value class.
        Parameters:
        value - - the value
        valueClass - - the value class
        Returns:
        the formatted value
      • formatString

        public static java.lang.String formatString​(java.lang.String value)
        Formats the value using String as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatBoolean

        public static java.lang.String formatBoolean​(java.lang.String value)
        Formats the value using Boolean as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatShort

        public static java.lang.String formatShort​(java.lang.String value)
        Formats the value using Short as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatInteger

        public static java.lang.String formatInteger​(java.lang.String value)
        Formats the value using Integer as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatLong

        public static java.lang.String formatLong​(java.lang.String value)
        Formats the value using Long as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatFloat

        public static java.lang.String formatFloat​(java.lang.String value)
        Formats the value using Float as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatDouble

        public static java.lang.String formatDouble​(java.lang.String value)
        Formats the value using Double as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatBigInteger

        public static java.lang.String formatBigInteger​(java.lang.String value)
        Formats the value using BigInteger as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatBigDecimal

        public static java.lang.String formatBigDecimal​(java.lang.String value)
        Formats the value using BigDecimal as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value
      • formatDate

        public static java.lang.String formatDate​(java.lang.String value)
        Formats the value using Date as value type.
        Parameters:
        value - - the value to format
        Returns:
        the formatted value