Class Service

java.lang.Object
proseccoCoding.TLN.model.Service

public class Service extends Object
This class represents a Trusted Service with his name, type, status and provider. It is recommended to not instantiate the Provider object in the constructor of the Service, but to pass the effective Provider object that contains this service. This parameter is only for having additional info for this provider, not for deep business logic purposes.
  • Field Details

    • name

      private String name
      Complete name of the service
    • types

      private ArrayList<ServiceType> types
      Type of the service
    • status

      private String status
      Status of the service
    • provider

      private Provider provider
      Provider that provides this service
  • Constructor Details

    • Service

      public Service(String name, ArrayList<ServiceType> types, String status, Provider provider)
      Constructor for a service object
      Parameters:
      name - complete name of the service
      types - ArrayList containing all ServiceType objects representing the service
      status - the status relative to this service
      provider - the provider that offers this service (not required)
      Throws:
      IllegalArgumentException - if at least one required parameter is null or types is empty
  • Method Details

    • getName

      public String getName()
      Getter for service name
      Returns:
      The service name string
    • getTypes

      public ArrayList<ServiceType> getTypes()
      Getter for service type
      Returns:
      The ServiceType object
    • getStatus

      public String getStatus()
      Getter for service status
      Returns:
      The service status string
    • getProvider

      public Provider getProvider()
      Getter for the service provider, could be null if it is not known
      Returns:
      The Provider object
    • hashCode

      public int hashCode()
      Gets the hash code for this service calculated with both name and type
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Compares the given Service object to this one by comparing both name and type
      Overrides:
      equals in class Object