Package jadex.bridge.service.search
Class ServiceQuery.Multiplicity
- java.lang.Object
-
- jadex.bridge.service.search.ServiceQuery.Multiplicity
-
- Enclosing class:
- ServiceQuery<T>
public static class ServiceQuery.Multiplicity extends java.lang.Object
Define cases for multiplicity.
-
-
Field Summary
Fields Modifier and Type Field Description static ServiceQuery.Multiplicity
ONE
'1' multiplicity for required service (default for searchService methods).static ServiceQuery.Multiplicity
ONE_MANY
'1..*' multiplicity for required service (default for searchService methods).static ServiceQuery.Multiplicity
ZERO_MANY
'0..*' multiplicity for optional multi service (default for searchServices methods).static ServiceQuery.Multiplicity
ZERO_ONE
'0..1' multiplicity for single optional service.
-
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. the minimal number of services required.int
getTo()
Get the 'to' value, i.e.void
setFrom(int from)
Set the 'from' value, i.e. the minimal number of services required.void
setTo(int to)
Get the 'to' value, i.e.java.lang.String
toString()
Get a string representation of the multiplicity.
-
-
-
Field Detail
-
ZERO_ONE
public static ServiceQuery.Multiplicity ZERO_ONE
'0..1' multiplicity for single optional service.
-
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 classjava.lang.Object
-
-