Interface TypeParser<T>

Type Parameters:
T - the object value type produced by parse(CharSequence)

public interface TypeParser<T>
Parses textual values into a target typed value.
  • Method Summary

    Modifier and Type
    Method
    Description
    Parses a whole character sequence into an object value.
    default T
    parse(CharSequence s, int offset, int length)
    Parses a slice of a character sequence into an object value.
    default byte
    Parses a whole character sequence into a byte value.
    default byte
    parseByte(CharSequence s, int offset, int length)
    Parses a slice of a character sequence into a byte value.
    default double
    Parses a whole character sequence into a double value.
    default double
    parseDouble(CharSequence s, int offset, int length)
    Parses a slice of a character sequence into a double value.
    default int
    Parses a whole character sequence into an int value.
    default int
    parseInt(CharSequence s, int offset, int length)
    Parses a slice of a character sequence into an int value.
    default long
    Parses a whole character sequence into a long value.
    default long
    parseLong(CharSequence s, int offset, int length)
    Parses a slice of a character sequence into a long value.
  • Method Details

    • parse

      T parse(CharSequence s)
      Parses a whole character sequence into an object value.
      Parameters:
      s - the source text
      Returns:
      the parsed value, or null when parsing fails
    • parse

      default T parse(CharSequence s, int offset, int length)
      Parses a slice of a character sequence into an object value.
      Parameters:
      s - the source text
      offset - the start index
      length - the slice length
      Returns:
      the parsed value, or null when parsing fails
    • parseByte

      default byte parseByte(CharSequence s)
      Parses a whole character sequence into a byte value.
      Parameters:
      s - the source text
      Returns:
      the parsed byte
    • parseByte

      default byte parseByte(CharSequence s, int offset, int length)
      Parses a slice of a character sequence into a byte value.
      Parameters:
      s - the source characters
      offset - the start index
      length - the slice length
      Returns:
      the parsed byte
    • parseInt

      default int parseInt(CharSequence s)
      Parses a whole character sequence into an int value.
      Parameters:
      s - the source text
      Returns:
      the parsed int
    • parseInt

      default int parseInt(CharSequence s, int offset, int length)
      Parses a slice of a character sequence into an int value.
      Parameters:
      s - the source text
      offset - the start index
      length - the slice length
      Returns:
      the parsed int
    • parseLong

      default long parseLong(CharSequence s)
      Parses a whole character sequence into a long value.
      Parameters:
      s - the source text
      Returns:
      the parsed long
    • parseLong

      default long parseLong(CharSequence s, int offset, int length)
      Parses a slice of a character sequence into a long value.
      Parameters:
      s - the source text
      offset - the start index
      length - the slice length
      Returns:
      the parsed long
    • parseDouble

      default double parseDouble(CharSequence s)
      Parses a whole character sequence into a double value.
      Parameters:
      s - the source text
      Returns:
      the parsed double
    • parseDouble

      default double parseDouble(CharSequence s, int offset, int length)
      Parses a slice of a character sequence into a double value.
      Parameters:
      s - the source text
      offset - the start index
      length - the slice length
      Returns:
      the parsed double