- java.lang.Object
-
- org.omnifaces.resourcehandler.CombinedResourceInfo
-
public final class CombinedResourceInfo extends Object
This class is a wrapper which collects all combined resources and stores it in the cache. A builder has been provided to create an instance of combined resource info and put it in the cache if absent.
- Author:
- Bauke Scholtz
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CombinedResourceInfo.Builder
Use this builder to create an instance of combined resource info and put it in the cache if absent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
Returns true if the given object is also an instance ofCombinedResourceInfo
and its ID equals to the ID of the current combined resource info instance.static CombinedResourceInfo
get(String id)
Returns the combined resource info identified by the given ID from the cache.int
getContentLength()
Returns the content length in bytes of this combined resource info.long
getLastModified()
Returns the last modified timestamp in milliseconds of this combined resource info.Set<ResourceIdentifier>
getResourceIdentifiers()
Returns the ordered set of resource identifiers of this combined resource info.Set<Resource>
getResources()
Returns the ordered set of resources of this combined resource info.int
hashCode()
Returns the sum of the hash code of this class and the ID.String
toString()
Returns the string representation of this combined resource info in the format of
-
-
-
Method Detail
-
get
public static CombinedResourceInfo get(String id)
Returns the combined resource info identified by the given ID from the cache. A new one will be created based on the given ID if absent in cache.- Parameters:
id
- The ID of the combined resource info to be returned from the cache.- Returns:
- The combined resource info identified by the given ID from the cache.
-
equals
public boolean equals(Object other)
Returns true if the given object is also an instance ofCombinedResourceInfo
and its ID equals to the ID of the current combined resource info instance.
-
hashCode
public int hashCode()
Returns the sum of the hash code of this class and the ID.
-
toString
public String toString()
Returns the string representation of this combined resource info in the format ofCombinedResourceInfo[id,resourceIdentifiers]
Whereid
is the unique ID andresourceIdentifiers
is the ordered set of all resource identifiers as is been created with the builder.
-
getResourceIdentifiers
public Set<ResourceIdentifier> getResourceIdentifiers()
Returns the ordered set of resource identifiers of this combined resource info.- Returns:
- the ordered set of resource identifiers of this combined resource info.
-
getResources
public Set<Resource> getResources()
Returns the ordered set of resources of this combined resource info.- Returns:
- The ordered set of resources of this combined resource info.
-
getContentLength
public int getContentLength()
Returns the content length in bytes of this combined resource info.- Returns:
- The content length in bytes of this combined resource info.
-
getLastModified
public long getLastModified()
Returns the last modified timestamp in milliseconds of this combined resource info.- Returns:
- The last modified timestamp in milliseconds of this combined resource info.
-
-