Class PService

  • All Implemented Interfaces:
    java.lang.reflect.Type, PDescriptor

    public abstract class PService
    extends PDeclaredDescriptor
    Descriptor for a complete service.
    • Constructor Detail

      • PService

        public PService​(@Nonnull
                        java.lang.String programName,
                        @Nonnull
                        java.lang.String name,
                        @Nullable
                        PServiceProvider extendsService,
                        @Nonnull
                        java.util.Collection<? extends PServiceMethod> methods)
      • PService

        public PService​(@Nonnull
                        java.lang.String programName,
                        @Nonnull
                        java.lang.String name,
                        @Nullable
                        PServiceProvider extendsService,
                        @Nonnull
                        PServiceMethod[] methods)
    • Method Detail

      • getType

        @Nonnull
        public PType getType()
        Returns:
        Get the field type.
      • getDefaultValue

        @Nullable
        public java.lang.Object getDefaultValue()
        Specified by:
        getDefaultValue in interface PDescriptor
        Overrides:
        getDefaultValue in class PDeclaredDescriptor
        Returns:
        The default value for the type used for default and required fields. Note that some primitive types don't support null values, and will have methods returning a default value regardless of the field required value setting.
      • isInnerType

        public boolean isInnerType()
        Specified by:
        isInnerType in class PDeclaredDescriptor
        Returns:
        Returns true if the type is an inner type. Meaning it is contained within another type or service.
      • isAutoType

        public boolean isAutoType()
        Specified by:
        isAutoType in class PDeclaredDescriptor
        Returns:
        Returns true if the type is generated automatically by means of something else, e.g. request and response types for services. Or is a built in type as part of providence itself.
      • getExtendsService

        @Nullable
        public PService getExtendsService()
        Get the service that this service extends.
        Returns:
        Extended service or null if none.
      • getMethods

        @Nonnull
        public java.util.Collection<? extends PServiceMethod> getMethods()
        Get the collection of methods for the service, including all inherited services.
        Returns:
        The collection of methods.
      • getMethod

        @Nullable
        public abstract PServiceMethod getMethod​(java.lang.String name)
        Get the method definition for the given method name.
        Parameters:
        name - The service method name.
        Returns:
        The service method.