Class SyntaxFragment

java.lang.Object
org.incendo.cloud.annotations.SyntaxFragment

@API(status=STABLE) public final class SyntaxFragment extends Object
Represents the fragment of the syntax making up a command.
  • Constructor Details

    • SyntaxFragment

      public SyntaxFragment(@NonNull String major, @NonNull List<@NonNull String> minor, @NonNull ArgumentMode argumentMode)
      Creates a new syntax fragment
      Parameters:
      major - the major portion of the fragment
      minor - the minor portions of the fragment
      argumentMode - the argument mode of the fragment
  • Method Details

    • major

      public @NonNull String major()
      Returns the major portion of the fragment.

      This is likely the name of an argument, or a string literal.

      Returns:
      the major part of the fragment
    • minor

      public @NonNull List<@NonNull String> minor()
      Returns the minor part of the fragment.

      This is likely a list of aliases.

      Returns:
      the minor part of the fragment.
    • argumentMode

      public @NonNull ArgumentMode argumentMode()
      Returns the argument mode.
      Returns:
      the argument mode