Class MethodParam

    • Field Detail

      • paramType

        protected final Class<?> paramType
      • expression

        protected final String expression
    • Constructor Detail

      • MethodParam

        protected MethodParam​(Class<?> paramType,
                              String expression)
    • Method Detail

      • getExpression

        public String getExpression()
      • getType

        protected Class<?> getType()
      • isDefault

        public boolean isDefault()
        Allows checking if a parameter is set to the default value.

        This is usually used in MethodCallBuilder instances to check if a parameter is set or not to some custom value, and some method chaingin is required or not.

        This method may, and is, overwritten by subclasses depending on the semantics of each type of parameter.

        Returns:
        true when the value is the default one or not specified (null), false otherwise.
      • isIgnored

        protected boolean isIgnored()
      • getStaticImports

        public Set<String> getStaticImports()
        Gets all classes that are required to be imported by generated code.

        Override this method if you implement a custom MethodParam that requires some particular import.

        Returns:
        the set of required classes names that need to be imported by generated code.
      • getImports

        public Set<String> getImports()
        Gets all classes that are required to be statically imported by generated code.

        Override this method if you implement a custom MethodParam that requires some particular static import.

        Returns:
        the set of required classes names that need to be statically imported by generated code.
      • buildStringLiteral

        protected static String buildStringLiteral​(String value,
                                                   String indent)
      • findConstantNamesMap

        protected static <T> Map<T,​String> findConstantNamesMap​(Class<?> constantsHolderClass,
                                                                      Class<T> constantClass,
                                                                      Predicate<Field> filter)