Record Class ElementServiceQuery<ServiceT>
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.query.ElementServiceQuery<ServiceT>
- Type Parameters:
ServiceT
-- Record Components:
element
-serviceKey
-
public record ElementServiceQuery<ServiceT>(Element element, ElementServiceKey<? extends ServiceT> serviceKey)
extends Record
implements Query<ServiceT>
-
Constructor Summary
ConstructorsConstructorDescriptionElementServiceQuery
(Element element, ElementServiceKey<? extends ServiceT> serviceKey) Creates an instance of aElementServiceQuery
record class. -
Method Summary
Modifier and TypeMethodDescriptionElementCallbackQuery
<? extends ServiceT> Queries fo raCallback
with the supplied method name and parameter types.element()
Returns the value of theelement
record component.final boolean
Indicates whether some other object is "equal to" this one.find()
Gets the result of theQuery
Optional
<ElementCallbackQuery<? extends ServiceT>> findCallback
(String methodName, Class<?>... parameters) Queries for aCallback
with the supplied method name and parameter types.final int
hashCode()
Returns a hash code value for this object.ElementServiceKey
<? extends ServiceT> Returns the value of theserviceKey
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ElementServiceQuery
Creates an instance of aElementServiceQuery
record class.- Parameters:
element
- the value for theelement
record componentserviceKey
- the value for theserviceKey
record component
-
-
Method Details
-
find
Description copied from interface:Query
Gets the result of theQuery
- Specified by:
find
in interfaceQuery<ServiceT>
- Returns:
- the query result
- Throws:
QueryException
-
callback
Queries fo raCallback
with the supplied method name and parameter types. -
findCallback
public Optional<ElementCallbackQuery<? extends ServiceT>> findCallback(String methodName, Class<?>... parameters) Queries for aCallback
with the supplied method name and parameter types.- Parameters:
methodName
- the method nameparameters
- the method parameters- Returns:
- an
ElementCallbackQuery
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
element
Returns the value of theelement
record component.- Returns:
- the value of the
element
record component
-
serviceKey
Returns the value of theserviceKey
record component.- Returns:
- the value of the
serviceKey
record component
-