Class ConstructUtil
java.lang.Object
net.officefloor.frame.impl.construct.util.ConstructUtil
Utility class to aid in construction of the
OfficeFloor.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionstatic ManagedFunctionMetaData<?,?> getFunctionMetaData(ManagedFunctionReference functionReference, ManagedFunctionLocator functionLocator, OfficeFloorIssues issues, OfficeFloorIssues.AssetType assetType, String assetName, String forItemDescription) Obtains theManagedFunctionMetaDatareporting any failure to find to theOfficeFloorIssues.static booleanIndicates whether the inputStringis eithernullor empty.static FlowMetaDatanewFlowMetaData(ManagedFunctionMetaData<?, ?> functionMetaData, boolean isSpawnThreadState) Creates a newFlowMetaData.static <T,E> T newInstance(Class<T> clazz, Class<E> expectedType, String creatingAssetName, OfficeFloorIssues.AssetType assetType, String assetName, OfficeFloorIssues issues) Constructs a new instance of the inputClassby its default constructor.static <T> T[]Convenience method forList.toArray(Object[])to pass compiler warnings for generic typed array.static <O> O[]
-
Method Details
-
isBlank
Indicates whether the inputStringis eithernullor empty.- Parameters:
value- Value to check.- Returns:
trueif blank.
-
newInstance
public static <T,E> T newInstance(Class<T> clazz, Class<E> expectedType, String creatingAssetName, OfficeFloorIssues.AssetType assetType, String assetName, OfficeFloorIssues issues) Constructs a new instance of the inputClassby its default constructor. If fails to instantiate, then reports issue viaOfficeFloorIssues.- Type Parameters:
T- Type of object to instantiate.E- Expected type that object is assignable.- Parameters:
clazz-Classto instantiate.expectedType- Expected type that is to be instantiated.creatingAssetName- Name of theAssetbeing created.assetType-OfficeFloorIssues.AssetType.assetName- Name ofOfficeFloorIssues.AssetType.issues-OfficeFloorIssues.- Returns:
- New instance or
nullif not able to instantiate.
-
toArray
-
toArray
Convenience method forList.toArray(Object[])to pass compiler warnings for generic typed array.- Type Parameters:
T- Element type.- Parameters:
list- List to transform into an array.type- Type of the array.- Returns:
- List as an array.
-
getFunctionMetaData
public static ManagedFunctionMetaData<?,?> getFunctionMetaData(ManagedFunctionReference functionReference, ManagedFunctionLocator functionLocator, OfficeFloorIssues issues, OfficeFloorIssues.AssetType assetType, String assetName, String forItemDescription) Obtains theManagedFunctionMetaDatareporting any failure to find to theOfficeFloorIssues.- Parameters:
functionReference-ManagedFunctionReference.functionLocator-ManagedFunctionLocatorto use to locate theManagedFunctionMetaData.issues-OfficeFloorIssues.assetType-OfficeFloorIssues.AssetTypefor reporting issues.assetName-Assetname for reporting issues.forItemDescription- Description after "for" indicating what theManagedFunctionMetaDatais for.- Returns:
ManagedFunctionMetaDataornullif not found with issues reported to theOfficeFloorIssues.
-
newFlowMetaData
public static FlowMetaData newFlowMetaData(ManagedFunctionMetaData<?, ?> functionMetaData, boolean isSpawnThreadState) Creates a new
FlowMetaData.This provides generic type safe creation.
- Parameters:
functionMetaData-ManagedFunctionMetaData.isSpawnThreadState-trueforFlowto spawn aThreadState.- Returns:
- New
FlowMetaData.
-