GeneratedOperation

interface GeneratedOperation<Connector : GeneratedConnector<Connector>, Data : Any?, Variables : Any?>

Known direct subclasses
GeneratedMutation

The specialization of GeneratedOperation for mutations.

GeneratedQuery

The specialization of GeneratedOperation for queries.


The parent of GeneratedQuery and GeneratedMutation, which are to be implemented by per-query and per-mutation classes, respectively, generated by the Firebase Tools code generation.

Safe for Concurrent Use

All methods and properties of GeneratedOperation are thread-safe and may be safely called and/or accessed concurrently from multiple threads and/or coroutines.

Stable for Inheritance

The GeneratedOperation interface is stable for inheritance in third-party libraries, as new methods will not be added to this interface and contracts of the existing methods will not be changed, except possibly during major version number changes.

Summary

Public functions

GeneratedOperation<Connector, Data, Variables>
@ExperimentalFirebaseDataConnect
copy(
    connector: Connector,
    operationName: String,
    dataDeserializer: DeserializationStrategy<Data>,
    variablesSerializer: SerializationStrategy<Variables>
)

Creates and returns a new object that is a copy of this object, but with the properties whose names corresponding to the given arguments changed to the respective argument's value.

operator Boolean
equals(other: Any?)

Compares this object with another object for equality.

Int

Calculates and returns the hash code for this object.

open OperationRef<Data, Variables>
ref(variables: Variables)

Returns a OperationRef that can be used to execute this operation with the given variables.

String

Returns a string representation of this object, useful for debugging.

GeneratedOperation<Connector, NewData, Variables>
@ExperimentalFirebaseDataConnect
<NewData : Any?> withDataDeserializer(
    dataDeserializer: DeserializationStrategy<NewData>
)

Creates and returns a new object that is a copy of this object, just like copy, except that the dataDeserializer can be a different type than Data.

GeneratedOperation<Connector, Data, NewVariables>
@ExperimentalFirebaseDataConnect
<NewVariables : Any?> withVariablesSerializer(
    variablesSerializer: SerializationStrategy<NewVariables>
)

Creates and returns a new object that is a copy of this object, just like copy, except that the variablesSerializer can be a different type than Variables.

Public properties

Connector

The GeneratedConnector with which this object is associated.

DeserializationStrategy<Data>

The deserializer to use to deserialize the response data for this operation.

String

The name of the operation, as defined in GraphQL.

SerializationStrategy<Variables>

The serializer to use to serialize the variables for this operation.

Public functions

copy

@ExperimentalFirebaseDataConnect
fun copy(
    connector: Connector = this.connector,
    operationName: String = this.operationName,
    dataDeserializer: DeserializationStrategy<Data> = this.dataDeserializer,
    variablesSerializer: SerializationStrategy<Variables> = this.variablesSerializer
): GeneratedOperation<Connector, Data, Variables>

Creates and returns a new object that is a copy of this object, but with the properties whose names corresponding to the given arguments changed to the respective argument's value.

This function is essentially the same as the copy() method that is generated by the Kotlin compiler for data class classes.

equals

operator fun equals(other: Any?): Boolean

Compares this object with another object for equality.

If this methods returns true then invoking any method or accessing any property on this should have the same side effects as accessing the same property or invoking the same method with the same arguments on other, respectively. The implementation checks for logical equality, rather than referential equality. A likely implementation looks like this:

override fun equals(other: Any?): Boolean =
other is DemoConnectorGeneratedQueryImpl<*,*> &&
other.connector == connector &&
other.operationName == operationName &&
other.dataDeserializer == dataDeserializer &&
other.variablesSerializer == variablesSerializer
Parameters
other: Any?

The object to compare to this for equality.

Returns
Boolean

true if, and only if, the given object is logically "equal" to this object.

hashCode

fun hashCode(): Int

Calculates and returns the hash code for this object.

Returns
Int

the hash code for this object.

ref

open fun ref(variables: Variables): OperationRef<Data, Variables>

Returns a OperationRef that can be used to execute this operation with the given variables.

toString

fun toString(): String

Returns a string representation of this object, useful for debugging.

The string representation is not guaranteed to be stable and may change without notice at any time. Therefore, the only recommended usage of the returned string is debugging and/or logging. Namely, parsing the returned string or storing the returned string in non-volatile storage should generally be avoided in order to be robust in case that the string representation changes.

Returns
String

a string representation of this object, which includes the class name and the values of all public properties.

withDataDeserializer

@ExperimentalFirebaseDataConnect
fun <NewData : Any?> withDataDeserializer(
    dataDeserializer: DeserializationStrategy<NewData>
): GeneratedOperation<Connector, NewData, Variables>

Creates and returns a new object that is a copy of this object, just like copy, except that the dataDeserializer can be a different type than Data.

withVariablesSerializer

@ExperimentalFirebaseDataConnect
fun <NewVariables : Any?> withVariablesSerializer(
    variablesSerializer: SerializationStrategy<NewVariables>
): GeneratedOperation<Connector, Data, NewVariables>

Creates and returns a new object that is a copy of this object, just like copy, except that the variablesSerializer can be a different type than Variables.

Public properties

connector

val connector: Connector

The GeneratedConnector with which this object is associated.

dataDeserializer

val dataDeserializerDeserializationStrategy<Data>

The deserializer to use to deserialize the response data for this operation.

See also
dataDeserializer

operationName

val operationNameString

The name of the operation, as defined in GraphQL.

See also
operationName

variablesSerializer

val variablesSerializerSerializationStrategy<Variables>

The serializer to use to serialize the variables for this operation.