Interface GetterPropertySelectionStrategy

  • All Known Implementing Classes:
    DefaultGetterPropertySelectionStrategy

    @Incubating
    public interface GetterPropertySelectionStrategy
    Used to define the strategy to detect the getters of a bean.

    A getter is considered as being a property of the bean and thus validated when validating the bean.

    Since:
    6.1.0
    Author:
    Marko Bekhta
    • Method Detail

      • getProperty

        Optional<String> getProperty​(ConstrainableExecutable executable)
        Returns the property corresponding to the getter if the method is considered a getter.
        Parameters:
        executable - a ConstrainableExecutable
        Returns:
        an optional containing the property corresponding to the given executable if it is considered a getter, or an empty optional otherwise
        Throws:
        IllegalArgumentException - if a property name cannot be constructed
      • getGetterMethodNameCandidates

        List<String> getGetterMethodNameCandidates​(String propertyName)
        Gives a set of possible method names based on a property name. Usually, it means a property name prefixed with something like "get", "is", "has" etc.
        Parameters:
        propertyName - a property name
        Returns:
        the Set of possible getter names