Class LiteralEntryData<T>


public class LiteralEntryData<T> extends KeyValueEntryData<T>
A specific KeyValueEntryData type designed to parse the entry's value as a supported literal type. This entry makes use of Classes.parse(String, Class, ParseContext) to parse the user's input using registered ClassInfos and Converters. This data CAN return null if the user's input is unable to be parsed as the expected type.
  • Constructor Details

    • LiteralEntryData

      public LiteralEntryData(String key, @Nullable T defaultValue, boolean optional, Class<T> type)
      Parameters:
      type - The type to parse the value into.
  • Method Details

    • getValue

      public @Nullable T getValue(String value)
      Description copied from class: KeyValueEntryData
      Parses a String value using this entry data.
      Specified by:
      getValue in class KeyValueEntryData<T>
      Parameters:
      value - The String value to parse.
      Returns:
      The parsed value.