Package de.fraunhofer.iosb.ilt.sta.query
Class Expansion
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.sta.query.Expansion
-
public class Expansion extends Object
Type safe builder of $expand queries. You can use it in a human readable way, e.g.:
This expansion would be valid for Thing requests and expand to the thing's locations, observations of the thing's datastreams and the sensor of each datastream of the thing.Expansion.of(EntityType.THING) .with(ExpandedEntity.of(EntityType.LOCATIONS)) .and(ExpandedEntity.of(EntityType.DATASTREAMS, EntityType.OBSERVATIONS)) .and(ExpandedEntity.of(EntityType.DATASTREAMS, EntityType.SENSOR));
- Author:
- Nils Sommer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Expansion
and(ExpandedEntity entity)
Expand to a referenced entity.static Expansion
of(EntityType type)
Start an expansion for the original entity type being requested.String
toString()
Expansion
with(ExpandedEntity entity)
Start an expansion query.
-
-
-
Method Detail
-
of
public static Expansion of(EntityType type)
Start an expansion for the original entity type being requested.- Parameters:
type
- the entity type- Returns:
- the expansion
-
with
public Expansion with(ExpandedEntity entity) throws InvalidRelationException
Start an expansion query.- Parameters:
entity
- the referenced entity- Returns:
- the Expansion instance
- Throws:
InvalidRelationException
- the expanded entity is not related to the requested entity
-
and
public Expansion and(ExpandedEntity entity) throws InvalidRelationException
Expand to a referenced entity.- Parameters:
entity
- the referenced entity- Returns:
- the Expansion instance
- Throws:
InvalidRelationException
- the expanded entity is not related to the requested entity
-
-