Interface In


public interface In
An interface for reading and decoding data from various sources.

This interface provides methods to read primitive types, strings, lists, and maps from an underlying data source. All methods return a Result that either contains the successfully decoded value or a DecodeError if the operation failed.

  • Method Details

    • type

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Type,DecodeError> type()
      Returns the type of the current value.
      Returns:
      a result containing the Type of the current value, or a DecodeError if the operation failed
    • readAsBoolean

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Boolean,DecodeError> readAsBoolean()
      Reads the current value as a Boolean.
      Returns:
      a result containing the Boolean value, or a DecodeError if the operation failed
    • readAsByte

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Byte,DecodeError> readAsByte()
      Reads the current value as a Byte.
      Returns:
      a result containing the Byte value, or a DecodeError if the operation failed
    • readAsChar

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Character,DecodeError> readAsChar()
      Reads the current value as a Character.
      Returns:
      a result containing the Character value, or a DecodeError if the operation failed
    • readAsDouble

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Double,DecodeError> readAsDouble()
      Reads the current value as a Double.
      Returns:
      a result containing the Double value, or a DecodeError if the operation failed
    • readAsFloat

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Float,DecodeError> readAsFloat()
      Reads the current value as a Float.
      Returns:
      a result containing the Float value, or a DecodeError if the operation failed
    • readAsInt

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Integer,DecodeError> readAsInt()
      Reads the current value as an Integer.
      Returns:
      a result containing the Integer value, or a DecodeError if the operation failed
    • readAsLong

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Long,DecodeError> readAsLong()
      Reads the current value as a Long.
      Returns:
      a result containing the Long value, or a DecodeError if the operation failed
    • readAsShort

      @NotNull @NotNull dev.siroshun.jfun.result.Result<Short,DecodeError> readAsShort()
      Reads the current value as a Short.
      Returns:
      a result containing the Short value, or a DecodeError if the operation failed
    • readAsString

      @NotNull @NotNull dev.siroshun.jfun.result.Result<String,DecodeError> readAsString()
      Reads the current value as a String.
      Returns:
      a result containing the String value, or a DecodeError if the operation failed
    • readList

      @NotNull <R> @NotNull dev.siroshun.jfun.result.Result<R,DecodeError> readList(@NotNull R identity, @NotNull @NotNull BiFunction<R,? super In,dev.siroshun.jfun.result.Result<?,?>> operator)
      Reads the current value as a list, using the provided identity object and operator.
      Type Parameters:
      R - the type of the result container
      Parameters:
      identity - an object that is used while processing the list elements, and will be returned as the result
      operator - a function that processes each element in the list using the provided In interface
      Returns:
      a result containing the constructed container, or a DecodeError if the operation failed
    • readMap

      @NotNull <R> @NotNull dev.siroshun.jfun.result.Result<R,DecodeError> readMap(@NotNull R identity, @NotNull @NotNull BiFunction<R,? super EntryIn,dev.siroshun.jfun.result.Result<?,?>> operator)
      Reads the current value as a map, using the provided identity object and operator.
      Type Parameters:
      R - the type of the result container
      Parameters:
      identity - an object that is used while processing the map entries, and will be returned as the result
      operator - a function that processes each entry in the map using the provided EntryIn interface
      Returns:
      a result containing the constructed container, or a DecodeError if the operation failed