EndpointPreferredType enum

Endpoint preferred types for performance optimization.

If Endpoint.preferredType getter overridden and isn't null, optimal EndpointCalling created during build.

Inheritance
Available extensions

Values

body → const EndpointPreferredType

The return type must be Body

response → const EndpointPreferredType

The return type must be Message.
You can create a Message instance with request.response function

Message can be Request or Response

anyEncodable → const EndpointPreferredType

The return type can be any json encodable instances like String, int, Map etc.
Look Body documentation for encodable objects.

in endpoint onCall;

  //preferredType => anyEncodable
  return "hello";

equal:

  return request.response(Body("hello"));
dbResult → const EndpointPreferredType

The return type must be DbResult.
in endpoint onCall;

  //preferredType => dbResult
  return await db.read(..);

equal:

  var dbResult = await db.read(..);
  return request.response(dbResult.data, headers: dbResult.headers,
    statusCode: dbResult.statusCode);
accessEvent → const EndpointPreferredType

The return type must be AccessEvent. in endpoint onCall;

  //preferredType => accessEvent
  return Read(..);

equal:

  var dbResult = await db.read(..);
  return request.response(dbResult.data, headers: dbResult.headers,
    statusCode: dbResult.statusCode);

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<EndpointPreferredType>
A constant List of the values in this enum, in order of their declaration.