org.fourthline.cling.model.types

## Class ServiceType

- java.lang.Object
- - org.fourthline.cling.model.types.ServiceType

- Direct Known Subclasses:
    UDAServiceType

      public class ServiceType
      extends Object

  Represents a service type, for example `urn:my-domain-namespace:service:MyService:1`.

  Although decimal versions are accepted and parsed, the version used for comparison is only the integer withou the fraction.

  Author:
    Christian Bauer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Pattern` | `BROKEN_PATTERN`
    `static Pattern` | `PATTERN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceType(String namespace, String type)`
    `ServiceType(String namespace, String type, int version)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getNamespace()`
    `String` | `getType()`
    `int` | `getVersion()`
    `int` | `hashCode()`
    `boolean` | `implementsVersion(ServiceType that)`
    `String` | `toFriendlyString()`
    `String` | `toString()`
    `static ServiceType` | `valueOf(String s)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PATTERN

          public static final Pattern PATTERN

    - #### BROKEN_PATTERN

          public static final Pattern BROKEN_PATTERN

  - ### Constructor Detail

    - #### ServiceType

          public ServiceType(String namespace,
                     String type)

    - #### ServiceType

          public ServiceType(String namespace,
                     String type,
                     int version)

  - ### Method Detail

    - #### getNamespace

          public String getNamespace()

    - #### getType

          public String getType()

    - #### getVersion

          public int getVersion()

    - #### valueOf

          public static ServiceType valueOf(String s)
                                     throws InvalidValueException

      Returns:
        Either a `UDAServiceType` or a more generic `ServiceType`.
      Throws:
        `InvalidValueException`

    - #### implementsVersion

          public boolean implementsVersion(ServiceType that)

      Returns:
        `true` if this type's namespace/name matches the other type's namespace/name and this type's version is equal or higher than the given types version.

    - #### toFriendlyString

          public String toFriendlyString()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2014 4th Line GmbH, Switzerland. All Rights Reserved.