Class ManagedFunctionTypeImpl<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.compile.impl.managedfunction.ManagedFunctionTypeImpl<M,F>
-
- All Implemented Interfaces:
ManagedFunctionType<M,F>
,ManagedFunctionTypeBuilder<M,F>
,AnnotatedType
public class ManagedFunctionTypeImpl<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>> extends java.lang.Object implements ManagedFunctionType<M,F>, ManagedFunctionTypeBuilder<M,F>
ManagedFunctionType
implementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ManagedFunctionTypeImpl(java.lang.String functionName, java.lang.Class<M> objectKeyClass, java.lang.Class<F> flowKeyClass)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedFunctionTypeBuilder<M,F>
addAnnotation(java.lang.Object annotation)
Adds an annotation.<E extends java.lang.Throwable>
ManagedFunctionEscalationTypeBuilderaddEscalation(java.lang.Class<E> escalationType)
Adds aManagedFunctionEscalationTypeBuilder
to theManagedFunctionTypeBuilder
definition.ManagedFunctionFlowTypeBuilder<F>
addFlow()
Adds aManagedFunctionFlowTypeBuilder
to theManagedFunctionTypeBuilder
definition.ManagedFunctionObjectTypeBuilder<M>
addObject(java.lang.Class<?> objectType)
Adds aManagedFunctionObjectTypeBuilder
to theManagedFunctionTypeBuilder
definition.java.lang.Object[]
getAnnotations()
Obtains the annotations.ManagedFunctionEscalationType[]
getEscalationTypes()
Obtains theManagedFunctionEscalationType
definitions for the possibleEscalationFlow
instances by theManagedFunction
.java.lang.Class<F>
getFlowKeyClass()
ManagedFunctionFlowType<F>[]
getFlowTypes()
Obtains theManagedFunctionFlowType
definitions for the possibleFlow
instances instigated by theManagedFunction
.java.lang.String
getFunctionName()
Obtains the name of theManagedFunction
.ManagedFunctionFactory<M,F>
getManagedFunctionFactory()
Obtains theManagedFunctionFactory
.java.lang.Class<M>
getObjectKeyClass()
Obtains theEnum
providing the keys for the dependentObject
instances.ManagedFunctionObjectType<M>[]
getObjectTypes()
Obtains theManagedFunctionObjectType
definitions for the dependentObject
instances required by theManagedFunction
.java.lang.Class<?>
getReturnType()
Obtains the type name ofObject
returned from theManagedFunction
that is to be used as the argument to the nextManagedFunction
.ManagedFunctionTypeBuilder<M,F>
setFunctionFactory(ManagedFunctionFactory<M,F> functionFactory)
Specifies theManagedFunctionFactory
to create theManagedFunction
.ManagedFunctionTypeBuilder<M,F>
setReturnType(java.lang.Class<?> returnType)
Specifies the type ofObject
returned from theManagedFunction
that is to be used as the argument to the nextManagedFunction
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.officefloor.compile.type.AnnotatedType
getAnnotation, getAnnotations
-
-
-
-
Constructor Detail
-
ManagedFunctionTypeImpl
public ManagedFunctionTypeImpl(java.lang.String functionName, java.lang.Class<M> objectKeyClass, java.lang.Class<F> flowKeyClass)
Initiate.- Parameters:
functionName
- Name of theManagedFunction
.objectKeyClass
-Enum
providing keys for dependentObject
instances.flowKeyClass
-Enum
providing keys for instigatedFlow
instances.
-
-
Method Detail
-
setFunctionFactory
public ManagedFunctionTypeBuilder<M,F> setFunctionFactory(ManagedFunctionFactory<M,F> functionFactory)
Description copied from interface:ManagedFunctionTypeBuilder
Specifies theManagedFunctionFactory
to create theManagedFunction
.- Specified by:
setFunctionFactory
in interfaceManagedFunctionTypeBuilder<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Parameters:
functionFactory
-ManagedFunctionFactory
to create theManagedFunction
.- Returns:
this
.
-
addAnnotation
public ManagedFunctionTypeBuilder<M,F> addAnnotation(java.lang.Object annotation)
Description copied from interface:ManagedFunctionTypeBuilder
Adds an annotation.- Specified by:
addAnnotation
in interfaceManagedFunctionTypeBuilder<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Parameters:
annotation
- Annotation.- Returns:
this
.
-
setReturnType
public ManagedFunctionTypeBuilder<M,F> setReturnType(java.lang.Class<?> returnType)
Description copied from interface:ManagedFunctionTypeBuilder
Specifies the type ofObject
returned from theManagedFunction
that is to be used as the argument to the nextManagedFunction
.- Specified by:
setReturnType
in interfaceManagedFunctionTypeBuilder<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Parameters:
returnType
- Return type of theManagedFunction
.- Returns:
this
.
-
addObject
public ManagedFunctionObjectTypeBuilder<M> addObject(java.lang.Class<?> objectType)
Description copied from interface:ManagedFunctionTypeBuilder
Adds a
ManagedFunctionObjectTypeBuilder
to theManagedFunctionTypeBuilder
definition.Should the dependent
Object
instances beIndexed
, the order they are added is the order of indexing (starting at 0).- Specified by:
addObject
in interfaceManagedFunctionTypeBuilder<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Parameters:
objectType
- Type of the dependentObject
.- Returns:
ManagedFunctionObjectTypeBuilder
to provide thetype definition
of the added dependentObject
.
-
addFlow
public ManagedFunctionFlowTypeBuilder<F> addFlow()
Description copied from interface:ManagedFunctionTypeBuilder
Adds a
ManagedFunctionFlowTypeBuilder
to theManagedFunctionTypeBuilder
definition.Should the
Flow
instigation beIndexed
, the order they are added is the order of indexing (starting at 0).- Specified by:
addFlow
in interfaceManagedFunctionTypeBuilder<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
ManagedFunctionFlowTypeBuilder
to provide thetype definition
of the possible instigatedFlow
by theManagedFunction
.
-
addEscalation
public <E extends java.lang.Throwable> ManagedFunctionEscalationTypeBuilder addEscalation(java.lang.Class<E> escalationType)
Description copied from interface:ManagedFunctionTypeBuilder
Adds aManagedFunctionEscalationTypeBuilder
to theManagedFunctionTypeBuilder
definition.- Specified by:
addEscalation
in interfaceManagedFunctionTypeBuilder<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Type Parameters:
E
-Escalation
type.- Parameters:
escalationType
- Type to be handled by anEscalationFlow
.- Returns:
ManagedFunctionEscalationTypeBuilder
to provide thetype definition
.
-
getFunctionName
public java.lang.String getFunctionName()
Description copied from interface:ManagedFunctionType
Obtains the name of theManagedFunction
.- Specified by:
getFunctionName
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
- Name of the
ManagedFunction
.
-
getManagedFunctionFactory
public ManagedFunctionFactory<M,F> getManagedFunctionFactory()
Description copied from interface:ManagedFunctionType
Obtains theManagedFunctionFactory
.- Specified by:
getManagedFunctionFactory
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
ManagedFunctionFactory
.
-
getAnnotations
public java.lang.Object[] getAnnotations()
Description copied from interface:AnnotatedType
Obtains the annotations.- Specified by:
getAnnotations
in interfaceAnnotatedType
- Returns:
- Annotations.
-
getObjectKeyClass
public java.lang.Class<M> getObjectKeyClass()
Description copied from interface:ManagedFunctionType
Obtains theEnum
providing the keys for the dependentObject
instances.- Specified by:
getObjectKeyClass
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
Enum
providing the dependentObject
keys ornull
ifIndexed
or no dependencies.
-
getObjectTypes
public ManagedFunctionObjectType<M>[] getObjectTypes()
Description copied from interface:ManagedFunctionType
Obtains theManagedFunctionObjectType
definitions for the dependentObject
instances required by theManagedFunction
.- Specified by:
getObjectTypes
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
ManagedFunctionObjectType
definitions for the dependentObject
instances required by theManagedFunction
.
-
getFlowKeyClass
public java.lang.Class<F> getFlowKeyClass()
Description copied from interface:ManagedFunctionType
- Specified by:
getFlowKeyClass
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
Enum
providing instigatedFlow
keys ornull
ifIndexed
or no instigatedFlow
instances.
-
getFlowTypes
public ManagedFunctionFlowType<F>[] getFlowTypes()
Description copied from interface:ManagedFunctionType
Obtains theManagedFunctionFlowType
definitions for the possibleFlow
instances instigated by theManagedFunction
.- Specified by:
getFlowTypes
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
ManagedFunctionFlowType
definitions for the possibleFlow
instances instigated by theManagedFunction
.
-
getEscalationTypes
public ManagedFunctionEscalationType[] getEscalationTypes()
Description copied from interface:ManagedFunctionType
Obtains theManagedFunctionEscalationType
definitions for the possibleEscalationFlow
instances by theManagedFunction
.- Specified by:
getEscalationTypes
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
ManagedFunctionEscalationType
definitions for the possibleEscalationFlow
instances by theManagedFunction
.
-
getReturnType
public java.lang.Class<?> getReturnType()
Description copied from interface:ManagedFunctionType
Obtains the type name ofObject
returned from theManagedFunction
that is to be used as the argument to the nextManagedFunction
.- Specified by:
getReturnType
in interfaceManagedFunctionType<M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
- Returns:
- Return type name of the
ManagedFunction
.
-
-