Class ServiceQuery.Multiplicity

  • Enclosing class:
    ServiceQuery<T>

    public static class ServiceQuery.Multiplicity
    extends java.lang.Object
    Define cases for multiplicity.
    • Constructor Summary

      Constructors 
      Constructor Description
      Multiplicity()
      Bean constructor.
      Multiplicity​(int from, int to)
      Create a multiplicity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFrom()
      Get the 'from' value, i.e.
      int getTo()
      Get the 'to' value, i.e.
      void setFrom​(int from)
      Set the 'from' value, i.e.
      void setTo​(int to)
      Get the 'to' value, i.e.
      java.lang.String toString()
      Get a string representation of the multiplicity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ONE

        public static ServiceQuery.Multiplicity ONE
        '1' multiplicity for required service (default for searchService methods).
      • ZERO_MANY

        public static ServiceQuery.Multiplicity ZERO_MANY
        '0..*' multiplicity for optional multi service (default for searchServices methods).
      • ONE_MANY

        public static ServiceQuery.Multiplicity ONE_MANY
        '1..*' multiplicity for required service (default for searchService methods).
    • Constructor Detail

      • Multiplicity

        public Multiplicity()
        Bean constructor. Not meant for direct use. Defaults to invalid multiplicity ('0..0')!
      • Multiplicity

        public Multiplicity​(int from,
                            int to)
        Create a multiplicity.
        Parameters:
        from - The minimal number of services for the search/query being considered successful (positive integer or 0).
        to - The maximal number of services returned by the search/query (positive integer or -1 for unlimited).
    • Method Detail

      • getFrom

        public int getFrom()
        Get the 'from' value, i.e. the minimal number of services required. Otherwise search ends with ServiceNotFoundException.
      • setFrom

        public void setFrom​(int from)
        Set the 'from' value, i.e. the minimal number of services required. Otherwise search ends with ServiceNotFoundException.
        Parameters:
        from - Positive integer or 0
      • getTo

        public int getTo()
        Get the 'to' value, i.e. The maximal number of services returned. Afterwards search/query will terminate.
      • setTo

        public void setTo​(int to)
        Get the 'to' value, i.e. The maximal number of services returned. Afterwards search/query will terminate.
        Parameters:
        to - Positive integer or -1 for unlimited.
      • toString

        public java.lang.String toString()
        Get a string representation of the multiplicity.
        Overrides:
        toString in class java.lang.Object