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 aElementQueryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.find()Gets theElementfor thisElementQuery.<ServiceT> Optional<ElementServiceQuery<ServiceT>> findService(ElementServiceKey<ServiceT> serviceKey) Finds aElementServiceQueryfrom the selectedElement.findService(String serviceKeyString) Finds aElementServiceQueryfrom the selectedElement.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.name()Returns the value of thenamerecord component.registry()Returns the value of theregistryrecord component.<ServiceT> ElementServiceQuery<ServiceT> service(ElementServiceKey<ServiceT> serviceKey) Gets theElementServiceQueryfor the specificElementServiceKey.Gets aElementServiceQueryfrom the selectedElement.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
find
Gets theElementfor thisElementQuery.- Specified by:
findin interfaceQuery<Element>- Returns:
- the
Element - Throws:
QueryException
-
findService
Finds aElementServiceQueryfrom the selectedElement.- Parameters:
serviceKeyString- the service key string- Returns:
- the
ElementServiceQuery
-
findService
public <ServiceT> Optional<ElementServiceQuery<ServiceT>> findService(ElementServiceKey<ServiceT> serviceKey) Finds aElementServiceQueryfrom the selectedElement.- Parameters:
serviceKey- the service key string- Returns:
- the
ElementServiceQuery
-
service
Gets aElementServiceQueryfrom the selectedElement.- Parameters:
serviceKeyString- the service key string- Returns:
- the
ElementServiceQuery
-
service
Gets theElementServiceQueryfor 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 theregistryrecord component.- Returns:
- the value of the
registryrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-