Enum Class Part.Type
- All Implemented Interfaces:
Serializable
,Comparable<Part.Type>
,Constable
- Enclosing class:
- Part
The type of a method name part. Used to create query parts in various ways.
- Author:
- Oliver Gierke, Thomas Darimont, Michael Cramer
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionextractProperty
(String part) Callback method to extract the actual propertyPath to be bound from the given part.static Part.Type
fromProperty
(String rawProperty) Returns all keywords supported by the currentPart.Type
.int
Returns the number of arguments the propertyPath binds.protected boolean
Returns whether the the type supports the given raw property.toString()
static Part.Type
Returns the enum constant of this class with the specified name.static Part.Type[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BETWEEN
-
IS_NOT_NULL
-
IS_NULL
-
LESS_THAN
-
LESS_THAN_EQUAL
-
GREATER_THAN
-
GREATER_THAN_EQUAL
-
BEFORE
-
AFTER
-
NOT_LIKE
-
LIKE
-
STARTING_WITH
-
ENDING_WITH
-
IS_NOT_EMPTY
-
IS_EMPTY
-
NOT_CONTAINING
-
CONTAINING
-
NOT_IN
-
IN
-
NEAR
-
WITHIN
-
REGEX
-
EXISTS
-
TRUE
-
FALSE
-
NEGATING_SIMPLE_PROPERTY
-
SIMPLE_PROPERTY
-
-
Field Details
-
ALL_KEYWORDS
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
fromProperty
Returns thePart.Type
of thePart
for the given raw propertyPath. This will try to detect e.g. keywords contained in the raw propertyPath that trigger special query creation. ReturnsSIMPLE_PROPERTY
by default.- Parameters:
rawProperty
-- Returns:
-
getKeywords
Returns all keywords supported by the currentPart.Type
.- Returns:
-
supports
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
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
-