Enum Class Part.Type

java.lang.Object
java.lang.Enum<Part.Type>
org.springframework.data.repository.query.parser.Part.Type
All Implemented Interfaces:
Serializable, Comparable<Part.Type>, Constable
Enclosing class:
Part

public static enum Part.Type extends Enum<Part.Type>
The type of a method name part. Used to create query parts in various ways.
Author:
Oliver Gierke, Thomas Darimont, Michael Cramer
  • Enum Constant Details

    • BETWEEN

      public static final Part.Type BETWEEN
    • IS_NOT_NULL

      public static final Part.Type IS_NOT_NULL
    • IS_NULL

      public static final Part.Type IS_NULL
    • LESS_THAN

      public static final Part.Type LESS_THAN
    • LESS_THAN_EQUAL

      public static final Part.Type LESS_THAN_EQUAL
    • GREATER_THAN

      public static final Part.Type GREATER_THAN
    • GREATER_THAN_EQUAL

      public static final Part.Type GREATER_THAN_EQUAL
    • BEFORE

      public static final Part.Type BEFORE
    • AFTER

      public static final Part.Type AFTER
    • NOT_LIKE

      public static final Part.Type NOT_LIKE
    • LIKE

      public static final Part.Type LIKE
    • STARTING_WITH

      public static final Part.Type STARTING_WITH
    • ENDING_WITH

      public static final Part.Type ENDING_WITH
    • IS_NOT_EMPTY

      public static final Part.Type IS_NOT_EMPTY
    • IS_EMPTY

      public static final Part.Type IS_EMPTY
    • NOT_CONTAINING

      public static final Part.Type NOT_CONTAINING
    • CONTAINING

      public static final Part.Type CONTAINING
    • NOT_IN

      public static final Part.Type NOT_IN
    • IN

      public static final Part.Type IN
    • NEAR

      public static final Part.Type NEAR
    • WITHIN

      public static final Part.Type WITHIN
    • REGEX

      public static final Part.Type REGEX
    • EXISTS

      public static final Part.Type EXISTS
    • TRUE

      public static final Part.Type TRUE
    • FALSE

      public static final Part.Type FALSE
    • NEGATING_SIMPLE_PROPERTY

      public static final Part.Type NEGATING_SIMPLE_PROPERTY
    • SIMPLE_PROPERTY

      public static final Part.Type SIMPLE_PROPERTY
  • Field Details

  • Method Details

    • values

      public static Part.Type[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Part.Type valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromProperty

      public static Part.Type fromProperty(String rawProperty)
      Returns the Part.Type of the Part for the given raw propertyPath. This will try to detect e.g. keywords contained in the raw propertyPath that trigger special query creation. Returns SIMPLE_PROPERTY by default.
      Parameters:
      rawProperty -
      Returns:
    • getKeywords

      public Collection<String> getKeywords()
      Returns all keywords supported by the current Part.Type.
      Returns:
    • supports

      protected boolean supports(String property)
      Returns whether the the type supports the given raw property. Default implementation checks whether the property ends with the registered keyword. Does not support the keyword if the property is a valid field as is.
      Parameters:
      property -
      Returns:
    • getNumberOfArguments

      public int getNumberOfArguments()
      Returns the number of arguments the propertyPath binds. By default this exactly one argument.
      Returns:
    • extractProperty

      public String extractProperty(String part)
      Callback method to extract the actual propertyPath to be bound from the given part. Strips the keyword from the part's end if available.
      Parameters:
      part -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Part.Type>