Interface StringConstraint

All Superinterfaces:
Constraint<String>
All Known Implementing Classes:
IconStringConstraints

public interface StringConstraint extends Constraint<String>
Represents a Constraint of the String type.
Since:
1.0.0.0
Author:
creatorfromhell
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    convert(String value)
    Used to convert the provided input into the specified object.
    default boolean
    Used to validate that the provided input is of the valid type.

    Methods inherited from interface net.tnemc.menu.core.constraints.Constraint

    asString, defaultValue, identifier
  • Method Details

    • convert

      default String convert(String value)
      Description copied from interface: Constraint
      Used to convert the provided input into the specified object.
      Specified by:
      convert in interface Constraint<String>
      Parameters:
      value - The string to convert into the object.
      Returns:
      An optional containing the converted value, or an empty optional if the provided input can't be converted into the specified object.
    • validate

      default boolean validate(String value)
      Description copied from interface: Constraint
      Used to validate that the provided input is of the valid type.
      Specified by:
      validate in interface Constraint<String>
      Parameters:
      value - The input to validate.
      Returns:
      True if the input is of the type associated with this constraint, otherwise false.