org.eclipse.ecf.discovery
Class ServiceProperties

java.lang.Object
  extended by org.eclipse.ecf.discovery.ServiceProperties
All Implemented Interfaces:
java.io.Serializable, IServiceProperties

public class ServiceProperties
extends java.lang.Object
implements IServiceProperties

Service properties implementation class for IServiceProperties. Subclasses may be created as appropriate.

See Also:
Serialized Form

Constructor Summary
ServiceProperties()
           
ServiceProperties(IServiceProperties sp)
          Creates a copy of the given IServiceProperties
ServiceProperties(java.util.Properties props)
           
 
Method Summary
 java.util.Properties asProperties()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getProperty(java.lang.String name)
          Get property as an Object.
 byte[] getPropertyBytes(java.lang.String name)
          Get property name as byte[].
 java.util.Enumeration getPropertyNames()
          Get property names.
 java.lang.String getPropertyString(java.lang.String name)
          Get property name as String.
 int hashCode()
           
 java.lang.Object setProperty(java.lang.String name, java.lang.Object value)
          Set property as Object.
 java.lang.Object setPropertyBytes(java.lang.String name, byte[] value)
          Set property as byte [].
 java.lang.Object setPropertyString(java.lang.String name, java.lang.String value)
          Set property as String.
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceProperties

public ServiceProperties()

ServiceProperties

public ServiceProperties(java.util.Properties props)

ServiceProperties

public ServiceProperties(IServiceProperties sp)
Creates a copy of the given IServiceProperties

Parameters:
sp -
Since:
2.1
Method Detail

getPropertyNames

public java.util.Enumeration getPropertyNames()
Description copied from interface: IServiceProperties
Get property names. This should return an Enumeration of String objects that identify all of the names in this IServiceProperties instance

Specified by:
getPropertyNames in interface IServiceProperties
Returns:
Enumeration of all service property names as Strings. Will not be null.

getPropertyString

public java.lang.String getPropertyString(java.lang.String name)
Description copied from interface: IServiceProperties
Get property name as String. Returns a valid String if there is a property of the given name. Returns null if there is no property by that name, or if the property has some other type than String.

Specified by:
getPropertyString in interface IServiceProperties
Parameters:
name - the name of the property to return. Must not be null.
Returns:
the property as a String. Will be null if property does not exist.

getPropertyBytes

public byte[] getPropertyBytes(java.lang.String name)
Description copied from interface: IServiceProperties
Get property name as byte[]. Returns a non-null byte[] if there is a property of the given name. Returns null if there is no property by that name, or if the property has some other type than byte[].

Specified by:
getPropertyBytes in interface IServiceProperties
Parameters:
name - the name of the property to return. Must not be null.
Returns:
the property as a byte[]. Will be null if property does not exist.

getProperty

public java.lang.Object getProperty(java.lang.String name)
Description copied from interface: IServiceProperties
Get property as an Object. Returns a non-null Object if there is a property of the given name. Returns null if there is no property by that name.

Specified by:
getProperty in interface IServiceProperties
Parameters:
name - the name of the property to return. Must not be null.
Returns:
the property as an Object. Returns null if there is no property of given name.

setProperty

public java.lang.Object setProperty(java.lang.String name,
                                    java.lang.Object value)
Description copied from interface: IServiceProperties
Set property as Object.

Specified by:
setProperty in interface IServiceProperties
Parameters:
name - the property name of the property. Must not be null.
value - the property value to associated with the name. Must not be null.
Returns:
Object that was previous value associated with given name. Null if not previously in properties

setPropertyBytes

public java.lang.Object setPropertyBytes(java.lang.String name,
                                         byte[] value)
Description copied from interface: IServiceProperties
Set property as byte [].

Specified by:
setPropertyBytes in interface IServiceProperties
Parameters:
name - the property name of the property. Must not be null.
value - the property value to associated with the name. Must not be null.
Returns:
Object that was previous value associated with given name. Null if not previously in properties

setPropertyString

public java.lang.Object setPropertyString(java.lang.String name,
                                          java.lang.String value)
Description copied from interface: IServiceProperties
Set property as String.

Specified by:
setPropertyString in interface IServiceProperties
Parameters:
name - the property name of the property. Must not be null.
value - the property value to associated with the name. Must not be null.
Returns:
Object that was previous value associated with given name. May be null if not previously in properties.

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface IServiceProperties
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Specified by:
hashCode in interface IServiceProperties
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

size

public int size()
Specified by:
size in interface IServiceProperties
Returns:
Answers the number of key/value pairs in this ServiceProperties
See Also:
Dictionary.size()

asProperties

public java.util.Properties asProperties()
Returns:
Properties
Since:
3.0