Class ServiceType

All Implemented Interfaces:
Serializable

public final class ServiceType extends ServiceDesignation
An abstract service type.
Author:
David M. Lloyd
See Also:
  • Method Details

    • implies

      public boolean implies(ServiceDesignation other)
      Description copied from class: ServiceDesignation
      Determine whether the given service designation is implied by this service designation.
      Specified by:
      implies in class ServiceDesignation
      Parameters:
      other - the other service designation
      Returns:
      true of the other service designation is implied by this one, false otherwise
    • implies

      public boolean implies(ServiceType serviceType)
      Determine if this service type implies the other service type. This is the case for any other service type which has the same abstract type and abstract type authority, and the same URL scheme and URL scheme authority (if one is specified) as this service type.
      Parameters:
      serviceType - the other service type (must not be null)
      Returns:
      true if the other service type is implied by this type, false otherwise
    • implies

      public boolean implies(ServiceURL serviceURL)
      Determine if this service type implies the given service URL. This is the case for any service URL which either has no abstract type and whose concrete type matches this service type's abstract type, or has an abstract type that is equal to this service type's abstract type and has a concrete type equal to this service type's concrete type.
      Parameters:
      serviceURL - the service URL (must not be null)
      Returns:
      true if the service URL is implied by this type, false otherwise
    • equals

      public boolean equals(ServiceType other)
      Determine if this service type is equal to another.
      Parameters:
      other - the other service type
      Returns:
      true if the service types are equal, false otherwise
    • equals

      public boolean equals(ServiceDesignation other)
      Determine if this service type is equal to another.
      Specified by:
      equals in class ServiceDesignation
      Parameters:
      other - the other service type
      Returns:
      true if the service types are equal, false otherwise
    • equals

      public boolean equals(Object other)
      Determine if this service type is equal to another.
      Specified by:
      equals in class ServiceDesignation
      Parameters:
      other - the other service type
      Returns:
      true if the service types are equal, false otherwise
    • hashCode

      public int hashCode()
      Get the hash code for this service type. Service types are immutable and are suitable for use as hash keys.
      Specified by:
      hashCode in class ServiceDesignation
      Returns:
      the hash code for this service type
    • toString

      public String toString()
      Get the string representation of this service type.
      Specified by:
      toString in class ServiceDesignation
      Returns:
      the string representation of this service type (not null)
    • getAbstractType

      public final String getAbstractType()
      Get the abstract type of this service type. If this service type has no URL scheme, then the abstract type is also the concrete type.
      Specified by:
      getAbstractType in class ServiceDesignation
      Returns:
      the abstract type (not null)
    • getAbstractTypeAuthority

      public final String getAbstractTypeAuthority()
      Get the abstract type authority of this service type. Abstract types with no authority will return null for this value.
      Specified by:
      getAbstractTypeAuthority in class ServiceDesignation
      Returns:
      the abstract type authority of this service type (may be null)
    • getUriScheme

      public String getUriScheme()
      Get the concrete type name of this service type, if any.
      Specified by:
      getUriScheme in class ServiceDesignation
      Returns:
      the concrete service type (may be null)
    • getUriSchemeAuthority

      public String getUriSchemeAuthority()
      Get the concrete type authority name of this service type, if any.
      Specified by:
      getUriSchemeAuthority in class ServiceDesignation
      Returns:
      the concrete type authority name (may be null)
    • of

      public static ServiceType of(String abstractType, String abstractTypeAuthority)
      Get a service type with the given abstract type and optional abstract type authority.
      Parameters:
      abstractType - the abstract service type (must not be null)
      abstractTypeAuthority - the abstract type authority (may be null)
      Returns:
      the service type (not null)
    • of

      public static ServiceType of(String abstractType, String abstractTypeAuthority, String concreteType, String concreteTypeAuthority)
      Get a service type with the given abstract and concrete type and optional abstract and/or concrete type authority.
      Parameters:
      abstractType - the abstract service type (must not be null)
      abstractTypeAuthority - the abstract type authority (may be null)
      concreteType - the concrete service type (must not be null)
      concreteTypeAuthority - the concrete type authority (may be null)
      Returns:
      the service type (not null)