Class ReflectionOpts<T extends Member>
java.lang.Object
ushiosan.jvm_utilities.lang.reflection.options.ReflectionOpts<T>
- Type Parameters:
T- reflection data type
Data class for data reflection options
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull ReflectionOpts<T>addPredicate(Predicate<T> @NotNull ... predicates) Add a new filter to the list of optionsbooleanData option to get only elements declared by the classstatic <T extends Member>
@NotNull ReflectionOpts<T>Returns the default instance.booleanData option to get only public elementsList of predicates for the data filterbooleanData option to perform the action recursivelysetDeclaredOnly(boolean declaredOnly) Change the state of the class to handle information not defined by the classsetOnlyPublic(boolean onlyPublic) Change the state of the class to handle private datafinal @NotNull ReflectionOpts<T>setPredicates(Predicate<T> @NotNull ... predicates) Add a new filter to the list of options.setRecursive(boolean recursive) Change the state of the class to handle recursively datasetSkipAbstracts(boolean skipAbstracts) Change the state of the class to handle abstract elementssetSkipStatic(boolean skipStatic) Change the state of the class to handle static elementsbooleanData option to exclude abstracts elementsbooleanData option to exclude static elementstoString()Object string representation
-
Constructor Details
-
ReflectionOpts
public ReflectionOpts()Default constructor
-
-
Method Details
-
getDefault
@Contract(" -> new") @NotNull public static <T extends Member> @NotNull ReflectionOpts<T> getDefault()Returns the default instance.- Type Parameters:
T- reflection data type- Returns:
- default instance
-
declaredOnly
public boolean declaredOnly()Data option to get only elements declared by the class- Returns:
declaredOnlyoption status
-
setDeclaredOnly
Change the state of the class to handle information not defined by the class- Parameters:
declaredOnly- new status- Returns:
- the same current object
-
onlyPublic
public boolean onlyPublic()Data option to get only public elements- Returns:
onlyPublicoption status
-
setOnlyPublic
Change the state of the class to handle private data- Parameters:
onlyPublic- new status- Returns:
- the same current object
-
recursive
public boolean recursive()Data option to perform the action recursively- Returns:
recursiveoption status
-
setRecursive
Change the state of the class to handle recursively data- Parameters:
recursive- new status- Returns:
- the same current object
-
skipAbstracts
public boolean skipAbstracts()Data option to exclude abstracts elements- Returns:
skipAbstractsoption status
-
setSkipAbstracts
Change the state of the class to handle abstract elements- Parameters:
skipAbstracts- new status- Returns:
- the same current object
-
skipStatic
public boolean skipStatic()Data option to exclude static elements- Returns:
skipStaticoption status
-
setSkipStatic
Change the state of the class to handle static elements- Parameters:
skipStatic- new status- Returns:
- the same current object
-
predicates
List of predicates for the data filter- Returns:
predicateListoption status
-
addPredicate
@SafeVarargs @NotNull public final @NotNull ReflectionOpts<T> addPredicate(Predicate<T> @NotNull ... predicates) Add a new filter to the list of options- Parameters:
predicates- all the filters you want to add- Returns:
- the same current object
-
setPredicates
@SafeVarargs @NotNull public final @NotNull ReflectionOpts<T> setPredicates(Predicate<T> @NotNull ... predicates) Add a new filter to the list of options.The main difference between this method and the
addPredicate(Predicate[])method is that this method rewrites the filters already applied, while theaddPredicate(Predicate[])method adds more filters to the existing ones.- Parameters:
predicates- all the filters you want to add- Returns:
- the same current object
-
toString
Object string representation
-