public final class Group extends Object
| Constructor and Description |
|---|
Group()
To be used by JSON serializer.
|
Group(String name)
Creates a group with a name.
|
| Modifier and Type | Method and Description |
|---|---|
Group |
addResource(Resource resource)
Add a
Resource to the collection of resources associated with this group. |
Group |
collectResourcesOfType(ResourceType type) |
boolean |
equals(Object obj) |
String |
getName() |
List<Resource> |
getResources() |
int |
hashCode() |
boolean |
hasResource(String resourceUri) |
boolean |
hasResourcesOfType(ResourceType resourceType)
Check if the group has at least one resource of some type.
|
void |
replace(Resource resource,
List<Resource> expandedResources)
Replace one resource with a list of other resources.
|
void |
setResources(List<Resource> resources)
This method will replace all earlier defined resources with the provided list of resources.
|
String |
toString() |
public Group()
public Group(String name)
name - of the group.public final boolean hasResourcesOfType(ResourceType resourceType)
resourceType - type of the searched resource.public boolean hasResource(String resourceUri)
Resource with an uri same as resourceUri is contained in this group.public void replace(Resource resource, List<Resource> expandedResources)
resource - to replace.expandedResources - a list of resources to replace. If this list is empty, the result is similar to removing the resource from
the group.IllegalArgumentException - when a missing resources is to be replaced.public final Group collectResourcesOfType(ResourceType type)
type - of resources to collect. This value should not be null.public Group addResource(Resource resource)
Resource to the collection of resources associated with this group.
The implementation is synchronized, because it mutates the collection.resource - Resource to add to this group (at the end).public final void setResources(List<Resource> resources)
resources - the resources to replace the underlying resources.public String getName()
Copyright © 2008-2013. All Rights Reserved.