citysdk.tourism.client.poi.lists
Class Resources

java.lang.Object
  extended by citysdk.tourism.client.poi.lists.Resources
All Implemented Interfaces:
Deserializable

public class Resources
extends java.lang.Object
implements Deserializable

Represents the resources provided by a server. It contains all the available HypermediaLink given by server alongside their API versions.

Author:
Pedro Cruz

Constructor Summary
Resources()
           
 
Method Summary
 void addResource(HypermediaLink link)
          Adds a HypermediaLink.
 HypermediaLink getHypermediaWithVersion(java.lang.String version)
          Gets the HypermediaLink with the given version.
 java.util.Set<java.lang.String> getResources(java.lang.String version)
          Gets all the resources of a given version
 java.util.Set<java.lang.String> getVersions()
          Gets all the versions stored
 boolean hasResource(java.lang.String version, ResourceTerms resource)
          Checks if this Resource has a given resource in a given version.
 boolean hasResourceParameter(java.lang.String version, ResourceTerms resource, ParameterTerms parameter)
          Checks whether a given resource in a given version allows the search using a given parameter
 boolean hasVersion(java.lang.String version)
          Checks the existance of a given version
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resources

public Resources()
Method Detail

addResource

public void addResource(HypermediaLink link)
Adds a HypermediaLink.

Parameters:
link - the HypermediaLink to be added.

hasResource

public boolean hasResource(java.lang.String version,
                           ResourceTerms resource)
Checks if this Resource has a given resource in a given version.

Parameters:
version - the version of the link
resource - the resource to be found.
Returns:
true if it has the given resource, false otherwise.

hasVersion

public boolean hasVersion(java.lang.String version)
Checks the existance of a given version

Parameters:
version - version to check
Returns:
true if it is available, false otherwise.

hasResourceParameter

public boolean hasResourceParameter(java.lang.String version,
                                    ResourceTerms resource,
                                    ParameterTerms parameter)
Checks whether a given resource in a given version allows the search using a given parameter

Parameters:
version - the wanted version
resource - the name of the resource
parameter - the search parameter
Returns:
true if it is allowed, false otherwise

getHypermediaWithVersion

public HypermediaLink getHypermediaWithVersion(java.lang.String version)
Gets the HypermediaLink with the given version.

Parameters:
version - the version of the HypermediaLink.
Returns:
the HypermediaLink corresponding to the given version or null if the version is not available

getResources

public java.util.Set<java.lang.String> getResources(java.lang.String version)
Gets all the resources of a given version

Parameters:
version - the wanted version
Returns:
a set of resources of the given version

getVersions

public java.util.Set<java.lang.String> getVersions()
Gets all the versions stored

Returns:
a set of versions