java.lang.Object
ushiosan.jvm_utilities.lang.reflection.options.ReflectionOpts<T>
Type Parameters:
T - reflection data type

public final class ReflectionOpts<T extends Member> extends Object
Data class for data reflection options
  • 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:
      declaredOnly option status
    • setDeclaredOnly

      @NotNull public @NotNull ReflectionOpts<T> setDeclaredOnly(boolean declaredOnly)
      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:
      onlyPublic option status
    • setOnlyPublic

      @NotNull public @NotNull ReflectionOpts<T> setOnlyPublic(boolean onlyPublic)
      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:
      recursive option status
    • setRecursive

      @NotNull public @NotNull ReflectionOpts<T> setRecursive(boolean recursive)
      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:
      skipAbstracts option status
    • setSkipAbstracts

      @NotNull public @NotNull ReflectionOpts<T> setSkipAbstracts(boolean skipAbstracts)
      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:
      skipStatic option status
    • setSkipStatic

      @NotNull public @NotNull ReflectionOpts<T> setSkipStatic(boolean skipStatic)
      Change the state of the class to handle static elements
      Parameters:
      skipStatic - new status
      Returns:
      the same current object
    • predicates

      @NotNull public @NotNull List<Predicate<T>> predicates()
      List of predicates for the data filter
      Returns:
      predicateList option 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 the addPredicate(Predicate[]) method adds more filters to the existing ones.

      Parameters:
      predicates - all the filters you want to add
      Returns:
      the same current object
    • toString

      @Contract(pure=true) @NotNull public @NotNull String toString()
      Object string representation
      Overrides:
      toString in class Object
      Returns:
      object string representation