Package org.omnifaces.resourcehandler
Class CombinedResourceInfo.Builder
- java.lang.Object
-
- org.omnifaces.resourcehandler.CombinedResourceInfo.Builder
-
- Enclosing class:
- CombinedResourceInfo
public static final class CombinedResourceInfo.Builder extends Object
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 Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CombinedResourceInfo.Builder
add(ResourceIdentifier resourceIdentifier)
Add the resource represented by the given resource identifier resources of this combined resource info.String
create()
Creates the CombinedResourceInfo instance in cache if absent and return its ID.boolean
isEmpty()
Returns true if there are no resources been added.
-
-
-
Method Detail
-
add
public CombinedResourceInfo.Builder add(ResourceIdentifier resourceIdentifier)
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
public String 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.
-
-