Class ImmutableMethod

    • Field Detail

      • definingClass

        @Nonnull
        protected final java.lang.String definingClass
      • name

        @Nonnull
        protected final java.lang.String name
      • parameters

        @Nonnull
        protected final com.google.common.collect.ImmutableList<? extends ImmutableMethodParameter> parameters
      • returnType

        @Nonnull
        protected final java.lang.String returnType
      • accessFlags

        protected final int accessFlags
      • annotations

        @Nonnull
        protected final com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> annotations
      • hiddenApiRestrictions

        @Nonnull
        protected final com.google.common.collect.ImmutableSet<HiddenApiRestriction> hiddenApiRestrictions
    • Constructor Detail

      • ImmutableMethod

        public ImmutableMethod​(@Nonnull
                               java.lang.String definingClass,
                               @Nonnull
                               java.lang.String name,
                               @Nullable
                               java.lang.Iterable<? extends MethodParameter> parameters,
                               @Nonnull
                               java.lang.String returnType,
                               int accessFlags,
                               @Nullable
                               java.util.Set<? extends Annotation> annotations,
                               @Nullable
                               java.util.Set<HiddenApiRestriction> hiddenApiRestrictions,
                               @Nullable
                               MethodImplementation methodImplementation)
      • ImmutableMethod

        public ImmutableMethod​(@Nonnull
                               java.lang.String definingClass,
                               @Nonnull
                               java.lang.String name,
                               @Nullable
                               com.google.common.collect.ImmutableList<? extends ImmutableMethodParameter> parameters,
                               @Nonnull
                               java.lang.String returnType,
                               int accessFlags,
                               @Nullable
                               com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> annotations,
                               @Nullable
                               com.google.common.collect.ImmutableSet<HiddenApiRestriction> hiddenApiRestrictions,
                               @Nullable
                               ImmutableMethodImplementation methodImplementation)
    • Method Detail

      • getName

        @Nonnull
        public java.lang.String getName()
        Description copied from interface: Method
        Gets the name of this method.
        Specified by:
        getName in interface Member
        Specified by:
        getName in interface Method
        Specified by:
        getName in interface MethodReference
        Returns:
        The name of this method
      • getParameterTypes

        @Nonnull
        public com.google.common.collect.ImmutableList<? extends java.lang.CharSequence> getParameterTypes()
        Description copied from interface: MethodReference
        Gets a list of the types of the parameters of this method.
        Specified by:
        getParameterTypes in interface MethodReference
        Returns:
        A list of the parameter types of this method, as strings.
      • getParameters

        @Nonnull
        public com.google.common.collect.ImmutableList<? extends ImmutableMethodParameter> getParameters()
        Description copied from interface: Method
        Gets a list of the parameters of this method. As per the MethodReference interface, the MethodParameter objects contained in the returned list also act as a simple reference to the type of the parameter. However, the MethodParameter object can also contain additional information about the parameter. Note: In some implementations, the returned list is likely to *not* provide efficient random access.
        Specified by:
        getParameters in interface Method
        Returns:
        A list of MethodParameter objects, representing the parameters of this method.
      • getReturnType

        @Nonnull
        public java.lang.String getReturnType()
        Description copied from interface: Method
        Gets the return type of this method.
        Specified by:
        getReturnType in interface Method
        Specified by:
        getReturnType in interface MethodReference
        Returns:
        The return type of this method.
      • getAccessFlags

        public int getAccessFlags()
        Description copied from interface: Method
        Gets the access flags for this method. This will be a combination of the AccessFlags.* flags that are marked as compatible for use with a method.
        Specified by:
        getAccessFlags in interface Member
        Specified by:
        getAccessFlags in interface Method
        Returns:
        The access flags for this method
      • getAnnotations

        @Nonnull
        public com.google.common.collect.ImmutableSet<? extends ImmutableAnnotation> getAnnotations()
        Description copied from interface: Method
        Gets a set of the annotations that are applied to this method. The annotations in the returned set are guaranteed to have unique types.
        Specified by:
        getAnnotations in interface Annotatable
        Specified by:
        getAnnotations in interface Method
        Returns:
        A set of the annotations that are applied to this method
      • getHiddenApiRestrictions

        @Nonnull
        public java.util.Set<HiddenApiRestriction> getHiddenApiRestrictions()
        Description copied from interface: Method
        Gets the hidden api restrictions for this method. This will contain at most 1 normal flag (with isDomainSpecificApiFlag() = false), and 1 domain-specific api flag (with isDomainSpecificApiFlag() = true)
        Specified by:
        getHiddenApiRestrictions in interface Member
        Specified by:
        getHiddenApiRestrictions in interface Method
        Returns:
        A set of the hidden api restrictions for this method.
      • getImplementation

        @Nullable
        public ImmutableMethodImplementation getImplementation()
        Description copied from interface: Method
        Gets a MethodImplementation object that defines the implementation of the method. If this is an abstract method in an abstract class, or an interface method in an interface definition, then the method has no implementation, and this will return null.
        Specified by:
        getImplementation in interface Method
        Returns:
        A MethodImplementation object defining the implementation of this method, or null if the method has no implementation
      • immutableSetOf

        @Nonnull
        public static com.google.common.collect.ImmutableSortedSet<ImmutableMethod> immutableSetOf​(@Nullable
                                                                                                   java.lang.Iterable<? extends Method> list)