Enum MatchResult
- java.lang.Object
-
- java.lang.Enum<MatchResult>
-
- org.spongepowered.asm.mixin.injection.selectors.MatchResult
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<MatchResult>
public enum MatchResult extends java.lang.Enum<MatchResult>
Result of atarget selectormatch operation which describes the type of match.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXACT_MATCHAll parts, including optional parts of the selector matched the candidate and this result is the best.MATCHA confident match, but not an exact match.NONENo result, the selector does not match the candidateWEAKMatches only in the weakest sense, use this result only if all else fails and nothing else matches at all
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAtLeast(MatchResult other)Get whether this match level represents a level which is the same or greater than the supplied levelbooleanisExactMatch()Get whether this is an exact matchbooleanisMatch()Get whether this match succeededstatic MatchResultvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static MatchResult[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final MatchResult NONE
No result, the selector does not match the candidate
-
WEAK
public static final MatchResult WEAK
Matches only in the weakest sense, use this result only if all else fails and nothing else matches at all
-
MATCH
public static final MatchResult MATCH
A confident match, but not an exact match. It may be that other optional parts of the selector did not match the candidate. For example this could mean that the selector matched case-insensitively. This is the best result if anEXACT_MATCHmatch is not found.
-
EXACT_MATCH
public static final MatchResult EXACT_MATCH
All parts, including optional parts of the selector matched the candidate and this result is the best. If more than one EXACT_MATCH is returned from a query, the first one should be used.
-
-
Method Detail
-
values
public static MatchResult[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MatchResult c : MatchResult.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MatchResult valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
isAtLeast
public boolean isAtLeast(MatchResult other)
Get whether this match level represents a level which is the same or greater than the supplied level- Parameters:
other- level to compare to- Returns:
- true if greater or equal
-
isMatch
public boolean isMatch()
Get whether this match succeeded
-
isExactMatch
public boolean isExactMatch()
Get whether this is an exact match
-
-