Class PService
- java.lang.Object
-
- net.morimekta.providence.descriptor.PDeclaredDescriptor
-
- net.morimekta.providence.descriptor.PService
-
- All Implemented Interfaces:
java.lang.reflect.Type
,PDescriptor
public abstract class PService extends PDeclaredDescriptor
Descriptor for a complete service.
-
-
Constructor Summary
Constructors Constructor Description PService(java.lang.String programName, java.lang.String name, PServiceProvider extendsService, java.util.Collection<? extends PServiceMethod> methods)
PService(java.lang.String programName, java.lang.String name, PServiceProvider extendsService, PServiceMethod[] methods)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getDefaultValue()
PService
getExtendsService()
Get the service that this service extends.abstract PServiceMethod
getMethod(java.lang.String name)
Get the method definition for the given method name.java.util.Collection<? extends PServiceMethod>
getMethods()
Get the collection of methods for the service, including all inherited services.PType
getType()
boolean
isAutoType()
boolean
isInnerType()
-
Methods inherited from class net.morimekta.providence.descriptor.PDeclaredDescriptor
getName, getProgramName, getQualifiedName, getTypeName, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.morimekta.providence.descriptor.PDescriptor
getQualifiedName
-
-
-
-
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 interfacePDescriptor
- Overrides:
getDefaultValue
in classPDeclaredDescriptor
- 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 classPDeclaredDescriptor
- 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 classPDeclaredDescriptor
- 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.
-
-