Package net.officefloor.plugin.variable
Class VariableOfficeExtensionService
- java.lang.Object
-
- net.officefloor.plugin.variable.VariableOfficeExtensionService
-
- All Implemented Interfaces:
OfficeExtensionService
,OfficeExtensionServiceFactory
,ServiceFactory<OfficeExtensionService>
public class VariableOfficeExtensionService extends java.lang.Object implements OfficeExtensionService, OfficeExtensionServiceFactory
- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
VariableOfficeExtensionService.ContextLogic<R,T extends java.lang.Throwable>
Context logic.
-
Constructor Summary
Constructors Constructor Description VariableOfficeExtensionService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OfficeExtensionService
createService(ServiceContext context)
Creates the service.void
extendOffice(OfficeArchitect officeArchitect, OfficeExtensionContext context)
Extends theOffice
.static <R,T extends java.lang.Throwable>
RrunInContext(java.util.Map<java.lang.String,java.util.function.Consumer<Var<?>>> decorators, VariableOfficeExtensionService.ContextLogic<R,T> logic)
Runs within context.
-
-
-
Method Detail
-
runInContext
public static <R,T extends java.lang.Throwable> R runInContext(java.util.Map<java.lang.String,java.util.function.Consumer<Var<?>>> decorators, VariableOfficeExtensionService.ContextLogic<R,T> logic) throws T extends java.lang.Throwable
Runs within context.- Parameters:
decorators
-Map
of decorators by variable name.logic
-VariableOfficeExtensionService.ContextLogic
.- Throws:
T
- Possible failure.T extends java.lang.Throwable
-
createService
public OfficeExtensionService createService(ServiceContext context) throws java.lang.Throwable
Description copied from interface:ServiceFactory
Creates the service.- Specified by:
createService
in interfaceServiceFactory<OfficeExtensionService>
- Parameters:
context
-ServiceContext
.- Returns:
- Service.
- Throws:
java.lang.Throwable
- If fails to create the service.
-
extendOffice
public void extendOffice(OfficeArchitect officeArchitect, OfficeExtensionContext context) throws java.lang.Exception
Description copied from interface:OfficeExtensionService
Extends theOffice
.- Specified by:
extendOffice
in interfaceOfficeExtensionService
- Parameters:
officeArchitect
-OfficeArchitect
.context
-OfficeExtensionContext
.- Throws:
java.lang.Exception
- If fails to extend theOffice
.
-
-