java.lang.Object
org.omnifaces.resourcehandler.CombinedResourceInfo.Builder
- Enclosing class:
- CombinedResourceInfo
Use this builder to create an instance of combined resource info and put it in the cache if absent.
- Author:
- Bauke Scholtz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(ResourceIdentifier resourceIdentifier) Add the resource represented by the given resource identifier resources of this combined resource info.create()Creates the CombinedResourceInfo instance in cache if absent and return its ID.booleanisEmpty()Returns true if there are no resources been added.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
add
Add the resource represented by the given resource identifier resources of this combined resource info. The insertion order is maintained and duplicates are filtered.- Parameters:
resourceIdentifier- The resource identifier of the resource to be added.- Returns:
- This builder.
-
isEmpty
public boolean isEmpty()Returns true if there are no resources been added. Use this method beforecreate()if it's unknown if there are any resources been added.- Returns:
- True if there are no resources been added, otherwise false.
-
create
Creates the CombinedResourceInfo instance in cache if absent and return its ID.- Returns:
- The ID of the CombinedResourceInfo instance.
- Throws:
IllegalStateException- If there are no resources been added. So, to prevent it beforehand, use theisEmpty()method to check if there are any resources been added.
-