net.sourceforge.wurfl.core.resource
Class ResourceData

java.lang.Object
  extended by net.sourceforge.wurfl.core.resource.ResourceData
All Implemented Interfaces:
Serializable, Comparable

public class ResourceData
extends Object
implements Serializable, Comparable

The ResourceData contain information obtained bay WURFLResource. At this moment the managed ModelDevices, the name and version of resource.

Version:
$Id: ResourceData.java 432 2010-05-06 12:12:53Z filippo.deluca $
Author:
Fantayeneh Asres Gizaw, Filippo De Luca
See Also:
Serialized Form

Constructor Summary
ResourceData(String name, String version, boolean patch, ModelDevices devices)
          Build ResourceData by name, version, patch flag and ModelDevices
ResourceData(String name, String version, ModelDevices devices)
          Build ResourceData by name, version and ModelDevices.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object obj)
          ResourceData is equals to another, if and only if, the info string are equal.
 ModelDevices getDevices()
          Returns maanged ModelDevices.
 String getInfo()
          Return info string of this resource.
 String getName()
          Returns the name of resource.
 String getVersion()
          Returns version string of the resource.
 int hashCode()
           
 boolean isPatch()
          Returns if this resource is a patch.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceData

public ResourceData(String name,
                    String version,
                    ModelDevices devices)
Build ResourceData by name, version and ModelDevices. By default this ResourceData is a root resource nor patch.

Parameters:
name - The name of source resource.
version - The version of source Resource
devices - The managed ModelDevices

ResourceData

public ResourceData(String name,
                    String version,
                    boolean patch,
                    ModelDevices devices)
Build ResourceData by name, version, patch flag and ModelDevices

Parameters:
name - The name of source resource.
version - The version of source Resource
patch - flag indicates if this resource is a patch.
devices - The managed ModelDevices
Method Detail

getName

public String getName()
Returns the name of resource.

Returns:
String represents the name of resource.

getVersion

public String getVersion()
Returns version string of the resource.

Returns:
String represents the version of resource.

isPatch

public boolean isPatch()
Returns if this resource is a patch.

Returns:
True if this resource is a patch, fase otherwise.

getInfo

public String getInfo()
Return info string of this resource. Info string is in the format: Root|Patch:Loacation:Version. The location may vary from URI to JDBC connection string, it depends by the source Resource.

Returns:
Info string for this resource.

getDevices

public ModelDevices getDevices()
Returns maanged ModelDevices.

Returns:
Set containing managed devices.

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
ResourceData is equals to another, if and only if, the info string are equal.

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2010 WURFL-Pro srl. All Rights Reserved.