public class SubQuery
extends java.lang.Object
| Constructor and Description |
|---|
SubQuery() |
| Modifier and Type | Method and Description |
|---|---|
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
allReferencingEObjects()
Navigates from an
EObject to all other EObjects that reference it. |
static <S> QueryStepBuilder<S,S> |
and(QueryStepBuilder<S,?>... subqueries) |
static <S> QueryStepBuilder<S,java.lang.Boolean> |
asBoolean()
Converts the elements in the current result set into
Booleans. |
static <S> NumericQueryStepBuilder<S,java.lang.Byte> |
asByte()
Converts the elements in the current result set into
Bytes. |
static <S> QueryStepBuilder<S,java.lang.Character> |
asCharacter()
Converts the elements in the current result set into
Characters. |
static <S> NumericQueryStepBuilder<S,java.lang.Double> |
asDouble()
Converts the elements in the current result set into
Doubles. |
static <S> EObjectQueryStepBuilder<S> |
asEObject()
Converts the elements in the current result set into
EObjects. |
static <S> NumericQueryStepBuilder<S,java.lang.Float> |
asFloat()
Converts the elements in the current result set into
Floats. |
static <S> NumericQueryStepBuilder<S,java.lang.Integer> |
asInteger()
Converts the elements in the current result set into
Integers. |
static <S> NumericQueryStepBuilder<S,java.lang.Long> |
asLong()
Converts the elements in the current result set into
Longs. |
static <S> NumericQueryStepBuilder<S,java.lang.Short> |
asShort()
Converts the elements in the current result set into
Shorts. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
eAllContents()
Navigates from an
EObject to its eAllContents. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
eContainer()
Navigates from an
EObject to its eContainer. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
eContents()
Navigates from an
EObject to its eContents. |
static UntypedQueryStepBuilder<org.eclipse.emf.ecore.EObject,java.lang.Object> |
eGet(org.eclipse.emf.ecore.EAttribute eAttribute)
Performs a
EObject.eGet(EStructuralFeature) operation on all EObjects in the current result and
forwards the result of this method. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
eGet(org.eclipse.emf.ecore.EReference eReference)
Performs a
EObject.eGet(EStructuralFeature) operation on all EObjects in the current result and
forwards the result of this method. |
static UntypedQueryStepBuilder<org.eclipse.emf.ecore.EObject,java.lang.Object> |
eGet(java.lang.String eStructuralFeatureName)
Performs a
EObject.eGet(EStructuralFeature) operation on all EObjects in the current result and
forwards the result of this method. |
static <S> UntypedQueryStepBuilder<S,S> |
filter(java.util.function.Predicate<S> predicate)
Applies the given filter predicate to all elements in the current result.
|
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
has(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
java.lang.Object value)
Filters all EObjects in the result set that have the given feature set to the given value.
|
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
has(java.lang.String eStructuralFeatureName,
java.lang.Object value)
Filters all EObjects in the result set that have the given feature set to the given value.
|
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
isInstanceOf(org.eclipse.emf.ecore.EClass eClass)
Filters all
EObjects that are an instance of the given EClass. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
isInstanceOf(org.eclipse.emf.ecore.EClass eClass,
boolean allowSubclasses)
Filters all
EObjects that are an instance of the given EClass. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
isInstanceOf(java.lang.String eClassName)
Filters all
EObjects that are a (direct or indirect) instance of an EClass with the given name. |
static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> |
isInstanceOf(java.lang.String eClassName,
boolean allowSubclasses)
Filters all
EObjects that are a (direct or indirect) instance of an EClass with the given name. |
static <S,E> UntypedQueryStepBuilder<S,E> |
map(java.util.function.Function<S,E> function)
Uses the given function to map each element from the current result set to a new element.
|
static <S> QueryStepBuilder<S,S> |
named(java.lang.String stepName)
Assigns the given name to this
QueryStepBuilder. |
static <S> UntypedQueryStepBuilder<S,S> |
notNull()
Filters out and discards all
null values from the current result set. |
static <S> QueryStepBuilder<S,S> |
or(QueryStepBuilder<S,?>... subqueries) |
static <S> QueryStepBuilder<S,java.lang.Object> |
union(QueryStepBuilder<S,?>... subqueries) |
public static <S> UntypedQueryStepBuilder<S,S> filter(java.util.function.Predicate<S> predicate)
predicate - The predicate to apply. Must not be null. All elements for which the predicate function
returns false will be filtered out and discarded.null.public static <S,E> UntypedQueryStepBuilder<S,E> map(java.util.function.Function<S,E> function)
function - The mapping function to apply. Must not be null. Should be idempotent and side-effect
free.null.public static <S> UntypedQueryStepBuilder<S,S> notNull()
null values from the current result set.
This is the same as:
query.filter(element -> element != null)
null.filter(Predicate)public static <S> EObjectQueryStepBuilder<S> asEObject()
EObjects.
This method first checks if the element in question is an instance of EObject. If it is an EObject, it is cast
down and forwarded. Otherwise, it is discarded, i.e. all non-EObjects will be filtered out. All null
values will also be filtered out.
null.public static <S> QueryStepBuilder<S,java.lang.Boolean> asBoolean()
Booleans.
This method first checks if the element in question is an instance of Boolean. If it is a Boolean, it is cast
down and forwarded. Otherwise, it is discarded, i.e. all non-Booleans will be filtered out. All null
values will also be filtered out.
null.public static <S> NumericQueryStepBuilder<S,java.lang.Byte> asByte()
Bytes.
This method first checks if the element in question is an instance of Byte. If it is a Byte, it is cast down and
forwarded. Otherwise, it is discarded, i.e. all non-Bytes will be filtered out. All null values will
also be filtered out.
null.public static <S> NumericQueryStepBuilder<S,java.lang.Short> asShort()
Shorts.
This method first checks if the element in question is an instance of Short. If it is a Short, it is cast down
and forwarded. Otherwise, it is discarded, i.e. all non-Shorts will be filtered out. All null values
will also be filtered out.
null.public static <S> QueryStepBuilder<S,java.lang.Character> asCharacter()
Characters.
This method first checks if the element in question is an instance of Character. If it is a Character, it is cast
down and forwarded. Otherwise, it is discarded, i.e. all non-Characters will be filtered out. All
null values will also be filtered out.
null.public static <S> NumericQueryStepBuilder<S,java.lang.Integer> asInteger()
Integers.
This method first checks if the element in question is an instance of Integer. If it is a Integer, it is cast
down and forwarded. Otherwise, it is discarded, i.e. all non-Integers will be filtered out. All null
values will also be filtered out.
null.public static <S> NumericQueryStepBuilder<S,java.lang.Long> asLong()
Longs.
This method first checks if the element in question is an instance of Long. If it is a Long, it is cast down and
forwarded. Otherwise, it is discarded, i.e. all non-Longs will be filtered out. All null values will
also be filtered out.
null.public static <S> NumericQueryStepBuilder<S,java.lang.Float> asFloat()
Floats.
This method first checks if the element in question is an instance of Float. If it is a Float, it is cast down
and forwarded. Otherwise, it is discarded, i.e. all non-Floats will be filtered out. All null values
will also be filtered out.
null.public static <S> NumericQueryStepBuilder<S,java.lang.Double> asDouble()
Doubles.
This method first checks if the element in question is an instance of Double. If it is a Double, it is cast down
and forwarded. Otherwise, it is discarded, i.e. all non-Doubles will be filtered out. All null
values will also be filtered out.
null.public static <S> QueryStepBuilder<S,S> named(java.lang.String stepName)
QueryStepBuilder.
Note that only the step is named. When coming back to this step, the query result may be different than it was when it was first reached, depending on the traversal.
stepName - The name of the step. Must not be null. Must be unique within the query.null.@SafeVarargs public static <S> QueryStepBuilder<S,java.lang.Object> union(QueryStepBuilder<S,?>... subqueries)
@SafeVarargs public static <S> QueryStepBuilder<S,S> and(QueryStepBuilder<S,?>... subqueries)
@SafeVarargs public static <S> QueryStepBuilder<S,S> or(QueryStepBuilder<S,?>... subqueries)
public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> has(java.lang.String eStructuralFeatureName, java.lang.Object value)
Any EObject that is an instance of an EClass which does not define any EAttribute or
EReference with the given name will be discarded and filtered out.
For determining the feature, EClass.getEStructuralFeature(String) is used per EObject
individually.
The value will be compared via Objects.equals(Object, Object).
eStructuralFeatureName - The name of the EStructuralFeature to filter by. Must not be null.value - The value to filter by. May be null.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> has(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, java.lang.Object value)
Any EObject that belongs to an EClass that does not support the given feature will be discarded
and filtered out.
The value will be compared via Objects.equals(Object, Object).
eStructuralFeature - The feature to filter by. Must not be null.value - The value to filter by. Must not be null.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> isInstanceOf(org.eclipse.emf.ecore.EClass eClass)
EObjects that are an instance of the given EClass.
This method also considers polymorphism, i.e. instances of Sub-EClasses will pass this filter as well.
This operation is null-safe. Any null values will be discarded and filtered out.
eClass - The EClass to filter by. Must not be null.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> isInstanceOf(org.eclipse.emf.ecore.EClass eClass, boolean allowSubclasses)
EObjects that are an instance of the given EClass.
This operation is null-safe. Any null values will be discarded and filtered out.
eClass - The EClass to filter by. Must not be null.allowSubclasses - Whether or not to allow subclasses of the given class.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> isInstanceOf(java.lang.String eClassName)
EObjects that are a (direct or indirect) instance of an EClass with the given name.
This method also considers polymorphism, i.e. instances of Sub-EClasses will pass this filter as well.
This operation is null-safe. Any null values will be discarded and filtered out.
eClassName - The name of the EClass to search for. Must not be null.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> isInstanceOf(java.lang.String eClassName, boolean allowSubclasses)
EObjects that are a (direct or indirect) instance of an EClass with the given name.
This operation is null-safe. Any null values will be discarded and filtered out.
eClassName - The name of the EClass to search for. Must not be null.allowSubclasses - Whether or not to allow subclasses of the given class.null.public static UntypedQueryStepBuilder<org.eclipse.emf.ecore.EObject,java.lang.Object> eGet(java.lang.String eStructuralFeatureName)
EObject.eGet(EStructuralFeature) operation on all EObjects in the current result and
forwards the result of this method.
If a given EObject does not have the EStructuralFeature set (i.e.
EObject.eIsSet(EStructuralFeature) returns false), then no value will be passed onwards. In
any other case, the returned value is passed onwards, even if that value is null.
eStructuralFeatureName - The name of the EStructuralFeature to get the value(s) for. Must not be null.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> eGet(org.eclipse.emf.ecore.EReference eReference)
EObject.eGet(EStructuralFeature) operation on all EObjects in the current result and
forwards the result of this method.
If a given EObject does not have the EStructuralFeature set (i.e.
EObject.eIsSet(EStructuralFeature) returns false), then no value will be passed onwards. In
any other case, the returned value is passed onwards, even if that value is null.
eReference - The EReference to get the value(s) for. Must not be null.null.public static UntypedQueryStepBuilder<org.eclipse.emf.ecore.EObject,java.lang.Object> eGet(org.eclipse.emf.ecore.EAttribute eAttribute)
EObject.eGet(EStructuralFeature) operation on all EObjects in the current result and
forwards the result of this method.
If a given EObject does not have the EStructuralFeature set (i.e.
EObject.eIsSet(EStructuralFeature) returns false), then no value will be passed onwards. In
any other case, the returned value is passed onwards, even if that value is null.
eAttribute - The EAttribute to get the value(s) for. Must not be null.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> eContainer()
EObject to its eContainer.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> eContents()
EObject to its eContents.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> eAllContents()
EObject to its eAllContents.null.public static EObjectQueryStepBuilder<org.eclipse.emf.ecore.EObject> allReferencingEObjects()
EObject to all other EObjects that reference it.
This means walking backwards all EReference instances that have the current EObject as target. This
method will include the eContainer.
null.