Class AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>
java.lang.Object
com.comphenix.protocol.reflect.fuzzy.AbstractFuzzyMember.Builder<T>
- Direct Known Subclasses:
FuzzyFieldContract.Builder,FuzzyMethodContract.Builder
- Enclosing class:
AbstractFuzzyMember<T extends Member>
public abstract static class AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>
extends Object
Represents a builder of a fuzzy member contract.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbanModifier(int modifier) Add a given bit-field of modifers that will skip or ignore members.abstract Tbuild()Build a new instance of this type.declaringClassDerivedOf(Class<?> declaringClass) Require that a member is defined by this exact class, or any super class.declaringClassExactType(Class<?> declaringClass) Require that a member is defined by this exact class.declaringClassMatching(AbstractFuzzyMatcher<Class<?>> classMatcher) Require that a member is defined by a class that matches the given matcher.declaringClassSuperOf(Class<?> declaringClass) Require that a member is defined by this exact class, or any super class.protected abstract TConstruct a new instance of the current type.Set the exact name of the member we are matching.Set the regular expresson that matches a members name.Set the regular expression pattern that matches a members name.requireModifier(int modifier) Add a given bit-field of required modifiers for every matching member.Require that every matching member is public.
-
Field Details
-
member
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
requireModifier
Add a given bit-field of required modifiers for every matching member.- Parameters:
modifier- - bit-field of modifiers that are required.- Returns:
- This builder, for chaining.
-
requirePublic
Require that every matching member is public.- Returns:
- This builder, for chaining.
-
banModifier
Add a given bit-field of modifers that will skip or ignore members.- Parameters:
modifier- - bit-field of modifiers to skip or ignore.- Returns:
- This builder, for chaining.
-
nameRegex
Set the regular expresson that matches a members name.- Parameters:
regex- - new regular expression of valid names.- Returns:
- This builder, for chaining.
-
nameRegex
Set the regular expression pattern that matches a members name.- Parameters:
pattern- - regular expression pattern for a valid name.- Returns:
- This builder, for chaining.
-
nameExact
Set the exact name of the member we are matching.This will overwrite the regular expression rule.
- Parameters:
name- - exact name.- Returns:
- This builder, for chaining.
-
declaringClassExactType
Require that a member is defined by this exact class.- Parameters:
declaringClass- - the declaring class of any matching member.- Returns:
- This builder, for chaining.
-
declaringClassSuperOf
Require that a member is defined by this exact class, or any super class.- Parameters:
declaringClass- - the declaring class.- Returns:
- This builder, for chaining.
-
declaringClassDerivedOf
Require that a member is defined by this exact class, or any super class.- Parameters:
declaringClass- - the declaring class.- Returns:
- This builder, for chaining.
-
declaringClassMatching
public AbstractFuzzyMember.Builder<T> declaringClassMatching(AbstractFuzzyMatcher<Class<?>> classMatcher) Require that a member is defined by a class that matches the given matcher.- Parameters:
classMatcher- - class matcher.- Returns:
- This builder, for chaining.
-
initialMember
Construct a new instance of the current type.- Returns:
- New instance.
-
build
Build a new instance of this type.Builders should call
AbstractFuzzyMember.prepareBuild()when constructing new objects.- Returns:
- New instance of this type.
-