Skip to content

Instantly share code, notes, and snippets.

@nsivabalan
Created August 21, 2020 14:05
Show Gist options
  • Save nsivabalan/0737fb99d34805854752e10c9bbce6b0 to your computer and use it in GitHub Desktop.
Save nsivabalan/0737fb99d34805854752e10c9bbce6b0 to your computer and use it in GitHub Desktop.
/**
* Generic interface to represent MethodInfo fo type <T>. Used to hold method info like url path,
* call type etc.
*
* @param <T>
*/
public interface MethodInfo<T> {
/** @return the methodInfo object as is. */
T getTransportMethodInfo();
/** @return the urlpath/endpoint of the request. */
@Nullable
String getUrlPath();
/** @return the servicename. Applicable for grpc transport. */
@Nullable
String getServiceName();
/** @return {@code true} if the method represents a unary calls. {@code false} otherwise. */
boolean isUnary();
/** @return the {@link MethodType} of the request. */
MethodType getMethodType();
/** @return {@code true} if the method is idempotent. {@link false} otherwise. */
boolean isIdempotent();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment