Record Class ElementQuery
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.query.ElementQuery
- Record Components:
registry
-name
-index
-
public record ElementQuery(ElementRegistry registry, String name, int index)
extends Record
implements Query<Element>
The beginning queyr for a
Element
instance based on a ElementRegistry
.-
Constructor Summary
ConstructorsConstructorDescriptionElementQuery
(ElementRegistry registry, String name, int index) Creates an instance of aElementQuery
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.find()
Gets theElement
for thisElementQuery
.<ServiceT> Optional
<ElementServiceQuery<ServiceT>> findService
(ElementServiceKey<ServiceT> serviceKey) Finds aElementServiceQuery
from the selectedElement
.findService
(String serviceKeyString) Finds aElementServiceQuery
from the selectedElement
.final int
hashCode()
Returns a hash code value for this object.int
index()
Returns the value of theindex
record component.name()
Returns the value of thename
record component.registry()
Returns the value of theregistry
record component.<ServiceT> ElementServiceQuery
<ServiceT> service
(ElementServiceKey<ServiceT> serviceKey) Gets theElementServiceQuery
for the specificElementServiceKey
.Gets aElementServiceQuery
from the selectedElement
.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
find
Gets theElement
for thisElementQuery
.- Specified by:
find
in interfaceQuery<Element>
- Returns:
- the
Element
- Throws:
QueryException
-
findService
Finds aElementServiceQuery
from the selectedElement
.- Parameters:
serviceKeyString
- the service key string- Returns:
- the
ElementServiceQuery
-
findService
public <ServiceT> Optional<ElementServiceQuery<ServiceT>> findService(ElementServiceKey<ServiceT> serviceKey) Finds aElementServiceQuery
from the selectedElement
.- Parameters:
serviceKey
- the service key string- Returns:
- the
ElementServiceQuery
-
service
Gets aElementServiceQuery
from the selectedElement
.- Parameters:
serviceKeyString
- the service key string- Returns:
- the
ElementServiceQuery
-
service
Gets theElementServiceQuery
for the specificElementServiceKey
.- Type Parameters:
ServiceT
-- Parameters:
serviceKey
- theElementServiceKey
- Returns:
- the
ElementServiceQuery
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
registry
Returns the value of theregistry
record component.- Returns:
- the value of the
registry
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
index
public int index()Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-