/** * Creates a new result for a status code and payload. * * @param status The status code indicating the outcome of the request. * @param payload The payload to convey to the sender of the request. * @param cacheDirective Restrictions regarding the caching of the payload by * the receiver of the result (may be {@code null}). * @param <T> The type of the payload that is conveyed in the result. * @return The result. */ public static <T> CredentialsResult<T> from(final int status, final T payload, final CacheDirective cacheDirective) { return new CredentialsResult<>(status, payload, cacheDirective); } }
/** * Creates a new result for a status code and payload. * * @param status The status code indicating the outcome of the request. * @param payload The payload to convey to the sender of the request. * @param cacheDirective Restrictions regarding the caching of the payload by * the receiver of the result (may be {@code null}). * @param <T> The type of the payload that is conveyed in the result. * @return The result. */ public static <T> CredentialsResult<T> from(final int status, final T payload, final CacheDirective cacheDirective) { return new CredentialsResult<>(status, payload, cacheDirective); } }
/** * Creates a new result for a status code. * * @param status The status code indicating the outcome of the request. * @param <T> The type of the payload that is conveyed in the result. * @return The result. */ public static <T> CredentialsResult<T> from(final int status) { return new CredentialsResult<>(status, null, CacheDirective.noCacheDirective()); }
/** * Creates a new result for a status code. * * @param status The status code indicating the outcome of the request. * @param <T> The type of the payload that is conveyed in the result. * @return The result. */ public static <T> CredentialsResult<T> from(final int status) { return new CredentialsResult<>(status, null, CacheDirective.noCacheDirective()); }
/** * Creates a new result for a status code and payload. * <p> * This method simply invokes {@link #from(int, Object, CacheDirective)} * with {@link CacheDirective#noCacheDirective()}. * * @param status The status code indicating the outcome of the request. * @param payload The payload to convey to the sender of the request. * @param <T> The type of the payload that is conveyed in the result. * @return The result. */ public static <T> CredentialsResult<T> from(final int status, final T payload) { return new CredentialsResult<>(status, payload, CacheDirective.noCacheDirective()); }
/** * Creates a new result for a status code and payload. * <p> * This method simply invokes {@link #from(int, Object, CacheDirective)} * with {@link CacheDirective#noCacheDirective()}. * * @param status The status code indicating the outcome of the request. * @param payload The payload to convey to the sender of the request. * @param <T> The type of the payload that is conveyed in the result. * @return The result. */ public static <T> CredentialsResult<T> from(final int status, final T payload) { return new CredentialsResult<>(status, payload, CacheDirective.noCacheDirective()); }