Package org.eclipse.ecf.discovery
Class ServiceProperties
java.lang.Object
org.eclipse.ecf.discovery.ServiceProperties
- All Implemented Interfaces:
Serializable
,IServiceProperties
Service properties implementation class for
IServiceProperties
.
Subclasses may be created as appropriate.- See Also:
-
Constructor Summary
ConstructorDescriptionServiceProperties
(Properties props) Creates a copy of the givenIServiceProperties
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getProperty
(String name) Get property as an Object.byte[]
getPropertyBytes
(String name) Get property name as byte[].Get property names.getPropertyString
(String name) Get property name as String.int
hashCode()
setProperty
(String name, Object value) Set property as Object.setPropertyBytes
(String name, byte[] value) Set property as byte [].setPropertyString
(String name, String value) Set property as String.int
size()
toString()
-
Constructor Details
-
ServiceProperties
public ServiceProperties() -
ServiceProperties
-
ServiceProperties
Creates a copy of the givenIServiceProperties
- Parameters:
sp
- service properties- Since:
- 2.1
-
-
Method Details
-
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 interfaceIServiceProperties
- Returns:
- Enumeration of all service property names as Strings. Will not be
null
.
-
getPropertyString
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 interfaceIServiceProperties
- Parameters:
name
- the name of the property to return. Must not benull
.- Returns:
- the property as a String. Will be
null
if property does not exist.
-
getPropertyBytes
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 interfaceIServiceProperties
- Parameters:
name
- the name of the property to return. Must not benull
.- Returns:
- the property as a byte[]. Will be
null
if property does not exist.
-
getProperty
Description copied from interface:IServiceProperties
Get property as an Object. Returns a non-null Object if there is a property of the given name. Returnsnull
if there is no property by that name.- Specified by:
getProperty
in interfaceIServiceProperties
- Parameters:
name
- the name of the property to return. Must not benull
.- Returns:
- the property as an Object. Returns
null
if there is no property of given name.
-
setProperty
Description copied from interface:IServiceProperties
Set property as Object.- Specified by:
setProperty
in interfaceIServiceProperties
- 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
Description copied from interface:IServiceProperties
Set property as byte [].- Specified by:
setPropertyBytes
in interfaceIServiceProperties
- 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
Description copied from interface:IServiceProperties
Set property as String.- Specified by:
setPropertyString
in interfaceIServiceProperties
- Parameters:
name
- the property name of the property. Must not benull
.value
- the property value to associated with the name. Must not benull
.- Returns:
- Object that was previous value associated with given name. May be
null
if not previously in properties.
-
equals
- Specified by:
equals
in interfaceIServiceProperties
- Overrides:
equals
in classObject
- See Also:
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceIServiceProperties
- Overrides:
hashCode
in classObject
- See Also:
-
toString
-
size
public int size()- Specified by:
size
in interfaceIServiceProperties
- Returns:
- Answers the number of key/value pairs in this ServiceProperties
- See Also:
-
asProperties
- Returns:
- Properties
- Since:
- 3.0
-