Package org.cip4.lib.xjdf.util
Class Resources
java.lang.Object
org.cip4.lib.xjdf.util.Resources
This class provides access to Resources within ResourceSets.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Resources(@NotNull List<ResourceSet> resourceSets) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddResource(@NotNull Resource resource, @Nullable String processUsage) Add an Resource to the corresponding ResourceSet.final voidaddResource(@NotNull SpecificResource specificResource, @Nullable Part part, @Nullable String processUsage) Add an Resource to the corresponding ResourceSet.final voidaddResourceSet(ResourceSet resourceSet) Add an ResourceSet to the known resources.<T extends SpecificResource>
List<T>findSpecificResource(Class<T> findClass, Part part, String processUsage) Returns a list of parameter types matching the selection.Getter for the ResourceSets.
-
Constructor Details
-
Resources
public Resources()Constructor. -
Resources
Constructor.- Parameters:
resourceSets- List of ResourceSets to operate on.
-
-
Method Details
-
addResource
public final void addResource(@NotNull @NotNull Resource resource, @Nullable @Nullable String processUsage) Add an Resource to the corresponding ResourceSet. If the corresponding ResourceSet does not exist it will be created. New ResourceSets are added in lexicographic order of their attribute "name" while adding new entries after existing entries with the same "name". This method assumes that the ResourceSets are already ordered in lexicographic order of their "name"-attributes.- Parameters:
resource- Resource to addprocessUsage- Process usage of the resource
-
addResource
public final void addResource(@NotNull @NotNull SpecificResource specificResource, @Nullable @Nullable Part part, @Nullable @Nullable String processUsage) Add an Resource to the corresponding ResourceSet.- Parameters:
specificResource- Resource to addpart- Partition to add the resource toprocessUsage- Process usage of the resource
-
findSpecificResource
public <T extends SpecificResource> List<T> findSpecificResource(Class<T> findClass, Part part, String processUsage) Returns a list of parameter types matching the selection.- Parameters:
findClass- The class to search for in the list.part- The part to search for in the list.processUsage- ProcessUsage to search for.- Returns:
- A list of parameter types that matches the input parameters.
-
addResourceSet
Add an ResourceSet to the known resources. This method will insert the resources in lexicographic order while adding new sets with the same name after existing elements with the same name.- Parameters:
resourceSet- Set of resources to add.
-
getResourceSets
Getter for the ResourceSets.- Returns:
- List of ResourceSets.
-