|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.model.group.Group
public final class Group
A group is an entity holding a list of resources.
This class is thread safe.
| Constructor Summary | |
|---|---|
Group()
To be used by JSON serializer. |
|
Group(String name)
Creates a group with a name. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Group()
public Group(String name)
name - of the group.| Method Detail |
|---|
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 List<Resource> getResources()
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 boolean equals(Object obj)
equals in class Objectpublic String getName()
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||