Made helper functions static
This commit is contained in:
@@ -30,14 +30,13 @@ import groovy.lang.DelegatesTo;
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.3
|
||||
*/
|
||||
public class BodyMatchers {
|
||||
|
||||
protected final List<BodyMatcher> matchers = new LinkedList<>();
|
||||
|
||||
private final RegexPatterns regexPatterns = new RegexPatterns();
|
||||
|
||||
public void jsonPath(String path, MatchingTypeValue matchingType) {
|
||||
this.matchers.add(new PathBodyMatcher(path, matchingType));
|
||||
}
|
||||
@@ -71,16 +70,15 @@ public class BodyMatchers {
|
||||
}
|
||||
|
||||
public MatchingTypeValue byDate() {
|
||||
return new MatchingTypeValue(MatchingType.DATE, this.regexPatterns.isoDate());
|
||||
return new MatchingTypeValue(MatchingType.DATE, RegexPatterns.isoDate());
|
||||
}
|
||||
|
||||
public MatchingTypeValue byTime() {
|
||||
return new MatchingTypeValue(MatchingType.TIME, this.regexPatterns.isoTime());
|
||||
return new MatchingTypeValue(MatchingType.TIME, RegexPatterns.isoTime());
|
||||
}
|
||||
|
||||
public MatchingTypeValue byTimestamp() {
|
||||
return new MatchingTypeValue(MatchingType.TIMESTAMP,
|
||||
this.regexPatterns.isoDateTime());
|
||||
return new MatchingTypeValue(MatchingType.TIMESTAMP, RegexPatterns.isoDateTime());
|
||||
}
|
||||
|
||||
public RegexMatchingTypeValue byRegex(String regex) {
|
||||
|
||||
@@ -32,12 +32,13 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* Contains useful common methods for the DSL.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class Common {
|
||||
|
||||
private final RegexPatterns regexPatterns = new RegexPatterns();
|
||||
|
||||
public Map<String, DslProperty> convertObjectsToDslProperties(
|
||||
Map<String, Object> body) {
|
||||
return body.entrySet().stream().collect(Collectors.toMap(
|
||||
@@ -324,79 +325,79 @@ public class Common {
|
||||
}
|
||||
|
||||
public RegexProperty onlyAlphaUnicode() {
|
||||
return regexPatterns.onlyAlphaUnicode();
|
||||
return RegexPatterns.onlyAlphaUnicode();
|
||||
}
|
||||
|
||||
public RegexProperty alphaNumeric() {
|
||||
return regexPatterns.alphaNumeric();
|
||||
return RegexPatterns.alphaNumeric();
|
||||
}
|
||||
|
||||
public RegexProperty number() {
|
||||
return regexPatterns.number();
|
||||
return RegexPatterns.number();
|
||||
}
|
||||
|
||||
public RegexProperty positiveInt() {
|
||||
return regexPatterns.positiveInt();
|
||||
return RegexPatterns.positiveInt();
|
||||
}
|
||||
|
||||
public RegexProperty anyBoolean() {
|
||||
return regexPatterns.anyBoolean();
|
||||
return RegexPatterns.anyBoolean();
|
||||
}
|
||||
|
||||
public RegexProperty anInteger() {
|
||||
return regexPatterns.anInteger();
|
||||
return RegexPatterns.anInteger();
|
||||
}
|
||||
|
||||
public RegexProperty aDouble() {
|
||||
return regexPatterns.aDouble();
|
||||
return RegexPatterns.aDouble();
|
||||
}
|
||||
|
||||
public RegexProperty ipAddress() {
|
||||
return regexPatterns.ipAddress();
|
||||
return RegexPatterns.ipAddress();
|
||||
}
|
||||
|
||||
public RegexProperty hostname() {
|
||||
return regexPatterns.hostname();
|
||||
return RegexPatterns.hostname();
|
||||
}
|
||||
|
||||
public RegexProperty email() {
|
||||
return regexPatterns.email();
|
||||
return RegexPatterns.email();
|
||||
}
|
||||
|
||||
public RegexProperty url() {
|
||||
return regexPatterns.url();
|
||||
return RegexPatterns.url();
|
||||
}
|
||||
|
||||
public RegexProperty httpsUrl() {
|
||||
return regexPatterns.httpsUrl();
|
||||
return RegexPatterns.httpsUrl();
|
||||
}
|
||||
|
||||
public RegexProperty uuid() {
|
||||
return regexPatterns.uuid();
|
||||
return RegexPatterns.uuid();
|
||||
}
|
||||
|
||||
public RegexProperty isoDate() {
|
||||
return regexPatterns.isoDate();
|
||||
return RegexPatterns.isoDate();
|
||||
}
|
||||
|
||||
public RegexProperty isoDateTime() {
|
||||
return regexPatterns.isoDateTime();
|
||||
return RegexPatterns.isoDateTime();
|
||||
}
|
||||
|
||||
public RegexProperty isoTime() {
|
||||
return regexPatterns.isoTime();
|
||||
return RegexPatterns.isoTime();
|
||||
}
|
||||
|
||||
public RegexProperty iso8601WithOffset() {
|
||||
return regexPatterns.iso8601WithOffset();
|
||||
return RegexPatterns.iso8601WithOffset();
|
||||
}
|
||||
|
||||
public RegexProperty nonEmpty() {
|
||||
return regexPatterns.nonEmpty();
|
||||
return RegexPatterns.nonEmpty();
|
||||
}
|
||||
|
||||
public RegexProperty nonBlank() {
|
||||
return regexPatterns.nonBlank();
|
||||
return RegexPatterns.nonBlank();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* Represents a set of headers of a request / response or a message.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Olga Maciaszek-Sharma
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class Headers {
|
||||
@@ -41,8 +44,6 @@ public class Headers {
|
||||
|
||||
private MediaTypes mediaTypes = new MediaTypes();
|
||||
|
||||
private HttpHeaders httpHeaders = new HttpHeaders();
|
||||
|
||||
private MessagingHeaders messagingHeaders = new MessagingHeaders();
|
||||
|
||||
private Set<Header> entries = new LinkedHashSet<>();
|
||||
@@ -74,7 +75,7 @@ public class Headers {
|
||||
}
|
||||
|
||||
public void contentType(String contentType) {
|
||||
header(httpHeaders.contentType(), matching(contentType));
|
||||
header(HttpHeaders.contentType(), matching(contentType));
|
||||
}
|
||||
|
||||
public void messagingContentType(String contentType) {
|
||||
@@ -151,14 +152,6 @@ public class Headers {
|
||||
this.mediaTypes = mediaTypes;
|
||||
}
|
||||
|
||||
public HttpHeaders getHttpHeaders() {
|
||||
return httpHeaders;
|
||||
}
|
||||
|
||||
public void setHttpHeaders(HttpHeaders httpHeaders) {
|
||||
this.httpHeaders = httpHeaders;
|
||||
}
|
||||
|
||||
public MessagingHeaders getMessagingHeaders() {
|
||||
return messagingHeaders;
|
||||
}
|
||||
@@ -180,243 +173,243 @@ public class Headers {
|
||||
}
|
||||
|
||||
public String accept() {
|
||||
return httpHeaders.accept();
|
||||
return HttpHeaders.accept();
|
||||
}
|
||||
|
||||
public String acceptCharset() {
|
||||
return httpHeaders.acceptCharset();
|
||||
return HttpHeaders.acceptCharset();
|
||||
}
|
||||
|
||||
public String acceptEncoding() {
|
||||
return httpHeaders.acceptEncoding();
|
||||
return HttpHeaders.acceptEncoding();
|
||||
}
|
||||
|
||||
public String acceptLanguage() {
|
||||
return httpHeaders.acceptLanguage();
|
||||
return HttpHeaders.acceptLanguage();
|
||||
}
|
||||
|
||||
public String acceptRanges() {
|
||||
return httpHeaders.acceptRanges();
|
||||
return HttpHeaders.acceptRanges();
|
||||
}
|
||||
|
||||
public String accessControlAllowCredentials() {
|
||||
return httpHeaders.accessControlAllowCredentials();
|
||||
return HttpHeaders.accessControlAllowCredentials();
|
||||
}
|
||||
|
||||
public String accessControlAllowHeaders() {
|
||||
return httpHeaders.accessControlAllowHeaders();
|
||||
return HttpHeaders.accessControlAllowHeaders();
|
||||
}
|
||||
|
||||
public String accessControlAllowMethods() {
|
||||
return httpHeaders.accessControlAllowMethods();
|
||||
return HttpHeaders.accessControlAllowMethods();
|
||||
}
|
||||
|
||||
public String accessControlAllowOrigin() {
|
||||
return httpHeaders.accessControlAllowOrigin();
|
||||
return HttpHeaders.accessControlAllowOrigin();
|
||||
}
|
||||
|
||||
public String accessControlExposeHeaders() {
|
||||
return httpHeaders.accessControlExposeHeaders();
|
||||
return HttpHeaders.accessControlExposeHeaders();
|
||||
}
|
||||
|
||||
public String accessControlMaxAge() {
|
||||
return httpHeaders.accessControlMaxAge();
|
||||
return HttpHeaders.accessControlMaxAge();
|
||||
}
|
||||
|
||||
public String accessControlRequestHeaders() {
|
||||
return httpHeaders.accessControlRequestHeaders();
|
||||
return HttpHeaders.accessControlRequestHeaders();
|
||||
}
|
||||
|
||||
public String accessControlRequestMethod() {
|
||||
return httpHeaders.accessControlRequestMethod();
|
||||
return HttpHeaders.accessControlRequestMethod();
|
||||
}
|
||||
|
||||
public String age() {
|
||||
return httpHeaders.age();
|
||||
return HttpHeaders.age();
|
||||
}
|
||||
|
||||
public String allow() {
|
||||
return httpHeaders.allow();
|
||||
return HttpHeaders.allow();
|
||||
}
|
||||
|
||||
public String authorization() {
|
||||
return httpHeaders.authorization();
|
||||
return HttpHeaders.authorization();
|
||||
}
|
||||
|
||||
public String cacheControl() {
|
||||
return httpHeaders.cacheControl();
|
||||
return HttpHeaders.cacheControl();
|
||||
}
|
||||
|
||||
public String connection() {
|
||||
return httpHeaders.connection();
|
||||
return HttpHeaders.connection();
|
||||
}
|
||||
|
||||
public String contentEncoding() {
|
||||
return httpHeaders.contentEncoding();
|
||||
return HttpHeaders.contentEncoding();
|
||||
}
|
||||
|
||||
public String contentDisposition() {
|
||||
return httpHeaders.contentDisposition();
|
||||
return HttpHeaders.contentDisposition();
|
||||
}
|
||||
|
||||
public String contentLanguage() {
|
||||
return httpHeaders.contentLanguage();
|
||||
return HttpHeaders.contentLanguage();
|
||||
}
|
||||
|
||||
public String contentLength() {
|
||||
return httpHeaders.contentLength();
|
||||
return HttpHeaders.contentLength();
|
||||
}
|
||||
|
||||
public String contentLocation() {
|
||||
return httpHeaders.contentLocation();
|
||||
return HttpHeaders.contentLocation();
|
||||
}
|
||||
|
||||
public String contentRange() {
|
||||
return httpHeaders.contentRange();
|
||||
return HttpHeaders.contentRange();
|
||||
}
|
||||
|
||||
public String contentType() {
|
||||
return httpHeaders.contentType();
|
||||
return HttpHeaders.contentType();
|
||||
}
|
||||
|
||||
public String cookie() {
|
||||
return httpHeaders.cookie();
|
||||
return HttpHeaders.cookie();
|
||||
}
|
||||
|
||||
public String date() {
|
||||
return httpHeaders.date();
|
||||
return HttpHeaders.date();
|
||||
}
|
||||
|
||||
public String etag() {
|
||||
return httpHeaders.etag();
|
||||
return HttpHeaders.etag();
|
||||
}
|
||||
|
||||
public String expect() {
|
||||
return httpHeaders.expect();
|
||||
return HttpHeaders.expect();
|
||||
}
|
||||
|
||||
public String expires() {
|
||||
return httpHeaders.expires();
|
||||
return HttpHeaders.expires();
|
||||
}
|
||||
|
||||
public String from() {
|
||||
return httpHeaders.from();
|
||||
return HttpHeaders.from();
|
||||
}
|
||||
|
||||
public String host() {
|
||||
return httpHeaders.host();
|
||||
return HttpHeaders.host();
|
||||
}
|
||||
|
||||
public String ifMatch() {
|
||||
return httpHeaders.ifMatch();
|
||||
return HttpHeaders.ifMatch();
|
||||
}
|
||||
|
||||
public String ifModifiedSince() {
|
||||
return httpHeaders.ifModifiedSince();
|
||||
return HttpHeaders.ifModifiedSince();
|
||||
}
|
||||
|
||||
public String ifNoneMatch() {
|
||||
return httpHeaders.ifNoneMatch();
|
||||
return HttpHeaders.ifNoneMatch();
|
||||
}
|
||||
|
||||
public String ifRange() {
|
||||
return httpHeaders.ifRange();
|
||||
return HttpHeaders.ifRange();
|
||||
}
|
||||
|
||||
public String ifUnmodifiedSince() {
|
||||
return httpHeaders.ifUnmodifiedSince();
|
||||
return HttpHeaders.ifUnmodifiedSince();
|
||||
}
|
||||
|
||||
public String lastModified() {
|
||||
return httpHeaders.lastModified();
|
||||
return HttpHeaders.lastModified();
|
||||
}
|
||||
|
||||
public String link() {
|
||||
return httpHeaders.link();
|
||||
return HttpHeaders.link();
|
||||
}
|
||||
|
||||
public String location() {
|
||||
return httpHeaders.location();
|
||||
return HttpHeaders.location();
|
||||
}
|
||||
|
||||
public String max_forwards() {
|
||||
return httpHeaders.max_forwards();
|
||||
return HttpHeaders.max_forwards();
|
||||
}
|
||||
|
||||
public String origin() {
|
||||
return httpHeaders.origin();
|
||||
return HttpHeaders.origin();
|
||||
}
|
||||
|
||||
public String pragma() {
|
||||
return httpHeaders.pragma();
|
||||
return HttpHeaders.pragma();
|
||||
}
|
||||
|
||||
public String proxyAuthenticate() {
|
||||
return httpHeaders.proxyAuthenticate();
|
||||
return HttpHeaders.proxyAuthenticate();
|
||||
}
|
||||
|
||||
public String proxyAuthorization() {
|
||||
return httpHeaders.proxyAuthorization();
|
||||
return HttpHeaders.proxyAuthorization();
|
||||
}
|
||||
|
||||
public String range() {
|
||||
return httpHeaders.range();
|
||||
return HttpHeaders.range();
|
||||
}
|
||||
|
||||
public String referer() {
|
||||
return httpHeaders.referer();
|
||||
return HttpHeaders.referer();
|
||||
}
|
||||
|
||||
public String retryAfter() {
|
||||
return httpHeaders.retryAfter();
|
||||
return HttpHeaders.retryAfter();
|
||||
}
|
||||
|
||||
public String server() {
|
||||
return httpHeaders.server();
|
||||
return HttpHeaders.server();
|
||||
}
|
||||
|
||||
public String setCookie() {
|
||||
return httpHeaders.setCookie();
|
||||
return HttpHeaders.setCookie();
|
||||
}
|
||||
|
||||
public String setCookie2() {
|
||||
return httpHeaders.setCookie2();
|
||||
return HttpHeaders.setCookie2();
|
||||
}
|
||||
|
||||
public String te() {
|
||||
return httpHeaders.te();
|
||||
return HttpHeaders.te();
|
||||
}
|
||||
|
||||
public String trailer() {
|
||||
return httpHeaders.trailer();
|
||||
return HttpHeaders.trailer();
|
||||
}
|
||||
|
||||
public String transferEncoding() {
|
||||
return httpHeaders.transferEncoding();
|
||||
return HttpHeaders.transferEncoding();
|
||||
}
|
||||
|
||||
public String upgrade() {
|
||||
return httpHeaders.upgrade();
|
||||
return HttpHeaders.upgrade();
|
||||
}
|
||||
|
||||
public String user_agent() {
|
||||
return httpHeaders.user_agent();
|
||||
return HttpHeaders.user_agent();
|
||||
}
|
||||
|
||||
public String vary() {
|
||||
return httpHeaders.vary();
|
||||
return HttpHeaders.vary();
|
||||
}
|
||||
|
||||
public String via() {
|
||||
return httpHeaders.via();
|
||||
return HttpHeaders.via();
|
||||
}
|
||||
|
||||
public String warning() {
|
||||
return httpHeaders.warning();
|
||||
return HttpHeaders.warning();
|
||||
}
|
||||
|
||||
public String wwwAuthenticate() {
|
||||
return httpHeaders.wwwAuthenticate();
|
||||
return HttpHeaders.wwwAuthenticate();
|
||||
}
|
||||
|
||||
public String allValue() {
|
||||
|
||||
@@ -20,535 +20,541 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
* Contains most commonly used http headers.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.2
|
||||
*/
|
||||
public class HttpHeaders {
|
||||
public final class HttpHeaders {
|
||||
|
||||
public HttpHeaders() {
|
||||
System.out.println("WARNING: HttpHeaders shouldn't be instantiated");
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Accept} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.2" > Section 5.3.2 of
|
||||
* @return The HTTP {@code Accept} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.3.2">Section 5.3.2 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String accept() {
|
||||
public static String accept() {
|
||||
return "Accept";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Accept-Charset} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.3" > Section 5.3.3 of
|
||||
* @return The HTTP {@code Accept-Charset} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.3.3">Section 5.3.3 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String acceptCharset() {
|
||||
public static String acceptCharset() {
|
||||
return "Accept-Charset";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Accept-Encoding} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.4" > Section 5.3.4 of
|
||||
* @return The HTTP {@code Accept-Encoding} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.3.4">Section 5.3.4 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String acceptEncoding() {
|
||||
public static String acceptEncoding() {
|
||||
return "Accept-Encoding";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Accept-Language} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.3.5" > Section 5.3.5 of
|
||||
* @return The HTTP {@code Accept-Language} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.3.5">Section 5.3.5 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String acceptLanguage() {
|
||||
public static String acceptLanguage() {
|
||||
return "Accept-Language";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Accept-Ranges} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-2.3" > Section 5.3.5 of
|
||||
* RFC 7233</a>
|
||||
* @return The HTTP {@code Accept-Ranges} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7233#section-2.3">Section 5.3.5 of RFC
|
||||
* 7233</a>
|
||||
*/
|
||||
public String acceptRanges() {
|
||||
public static String acceptRanges() {
|
||||
return "Accept-Ranges";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Credentials} response header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Allow-Credentials} response header field
|
||||
* name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlAllowCredentials() {
|
||||
public static String accessControlAllowCredentials() {
|
||||
return "Access-Control-Allow-Credentials";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Headers} response header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Allow-Headers} response header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlAllowHeaders() {
|
||||
public static String accessControlAllowHeaders() {
|
||||
return "Access-Control-Allow-Headers";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Methods} response header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Allow-Methods} response header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlAllowMethods() {
|
||||
public static String accessControlAllowMethods() {
|
||||
return "Access-Control-Allow-Methods";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Allow-Origin} response header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Allow-Origin} response header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlAllowOrigin() {
|
||||
public static String accessControlAllowOrigin() {
|
||||
return "Access-Control-Allow-Origin";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Expose-Headers} response header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Expose-Headers} response header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlExposeHeaders() {
|
||||
public static String accessControlExposeHeaders() {
|
||||
return "Access-Control-Expose-Headers";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Max-Age} response header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Max-Age} response header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlMaxAge() {
|
||||
public static String accessControlMaxAge() {
|
||||
return "Access-Control-Max-Age";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Request-Headers} request header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Request-Headers} request header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlRequestHeaders() {
|
||||
public static String accessControlRequestHeaders() {
|
||||
return "Access-Control-Request-Headers";
|
||||
}
|
||||
|
||||
/**
|
||||
* The CORS {@code Access-Control-Request-Method} request header field name.
|
||||
* @see <ahref="https://www.w3.org/TR/cors/" > CORS W3C recommendation</a>
|
||||
* @return The CORS {@code Access-Control-Request-Method} request header field name.
|
||||
* @see <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>
|
||||
*/
|
||||
public String accessControlRequestMethod() {
|
||||
public static String accessControlRequestMethod() {
|
||||
return "Access-Control-Request-Method";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Age} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.1" > Section 5.1 of RFC
|
||||
* @return The HTTP {@code Age} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.1">Section 5.1 of RFC
|
||||
* 7234</a>
|
||||
*/
|
||||
public String age() {
|
||||
public static String age() {
|
||||
return "Age";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Allow} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.4.1" > Section 7.4.1 of
|
||||
* @return The HTTP {@code Allow} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.4.1">Section 7.4.1 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String allow() {
|
||||
public static String allow() {
|
||||
return "Allow";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Authorization} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.2" > Section 4.2 of RFC
|
||||
* @return The HTTP {@code Authorization} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7235#section-4.2">Section 4.2 of RFC
|
||||
* 7235</a>
|
||||
*/
|
||||
public String authorization() {
|
||||
public static String authorization() {
|
||||
return "Authorization";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Cache-Control} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.2" > Section 5.2 of RFC
|
||||
* @return The HTTP {@code Cache-Control} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.2">Section 5.2 of RFC
|
||||
* 7234</a>
|
||||
*/
|
||||
public String cacheControl() {
|
||||
public static String cacheControl() {
|
||||
return "Cache-Control";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Connection} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-6.1" > Section 6.1 of RFC
|
||||
* @return The HTTP {@code Connection} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-6.1">Section 6.1 of RFC
|
||||
* 7230</a>
|
||||
*/
|
||||
public String connection() {
|
||||
public static String connection() {
|
||||
return "Connection";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Encoding} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.2.2" > Section 3.1.2.2
|
||||
* @return The HTTP {@code Content-Encoding} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.2.2">Section 3.1.2.2
|
||||
* of RFC 7231</a>
|
||||
*/
|
||||
public String contentEncoding() {
|
||||
public static String contentEncoding() {
|
||||
return "Content-Encoding";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Disposition} header field name
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6266" > RFC 6266</a>
|
||||
* @return The HTTP {@code Content-Disposition} header field name
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6266">RFC 6266</a>
|
||||
*/
|
||||
public String contentDisposition() {
|
||||
public static String contentDisposition() {
|
||||
return "Content-Disposition";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Language} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.3.2" > Section 3.1.3.2
|
||||
* @return The HTTP {@code Content-Language} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.3.2">Section 3.1.3.2
|
||||
* of RFC 7231</a>
|
||||
*/
|
||||
public String contentLanguage() {
|
||||
public static String contentLanguage() {
|
||||
return "Content-Language";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Length} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-3.3.2" > Section 3.3.2 of
|
||||
* @return The HTTP {@code Content-Length} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3.2">Section 3.3.2 of
|
||||
* RFC 7230</a>
|
||||
*/
|
||||
public String contentLength() {
|
||||
public static String contentLength() {
|
||||
return "Content-Length";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Location} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.4.2" > Section 3.1.4.2
|
||||
* @return The HTTP {@code Content-Location} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.4.2">Section 3.1.4.2
|
||||
* of RFC 7231</a>
|
||||
*/
|
||||
public String contentLocation() {
|
||||
public static String contentLocation() {
|
||||
return "Content-Location";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Range} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-4.2" > Section 4.2 of RFC
|
||||
* @return The HTTP {@code Content-Range} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7233#section-4.2">Section 4.2 of RFC
|
||||
* 7233</a>
|
||||
*/
|
||||
public String contentRange() {
|
||||
public static String contentRange() {
|
||||
return "Content-Range";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Content-Type} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" > Section 3.1.1.5
|
||||
* @return The HTTP {@code Content-Type} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5">Section 3.1.1.5
|
||||
* of RFC 7231</a>
|
||||
*/
|
||||
public String contentType() {
|
||||
public static String contentType() {
|
||||
return "Content-Type";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Cookie} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2109#section-4.3.4" > Section 4.3.4 of
|
||||
* @return The HTTP {@code Cookie} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2109#section-4.3.4">Section 4.3.4 of
|
||||
* RFC 2109</a>
|
||||
*/
|
||||
public String cookie() {
|
||||
public static String cookie() {
|
||||
return "Cookie";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Date} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" > Section 7.1.1.2
|
||||
* @return The HTTP {@code Date} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2">Section 7.1.1.2
|
||||
* of RFC 7231</a>
|
||||
*/
|
||||
public String date() {
|
||||
public static String date() {
|
||||
return "Date";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code ETag} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-2.3" > Section 2.3 of RFC
|
||||
* @return The HTTP {@code ETag} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-2.3">Section 2.3 of RFC
|
||||
* 7232</a>
|
||||
*/
|
||||
public String etag() {
|
||||
public static String etag() {
|
||||
return "ETag";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Expect} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.1.1" > Section 5.1.1 of
|
||||
* @return The HTTP {@code Expect} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.1.1">Section 5.1.1 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String expect() {
|
||||
public static String expect() {
|
||||
return "Expect";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Expires} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.3" > Section 5.3 of RFC
|
||||
* @return The HTTP {@code Expires} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.3">Section 5.3 of RFC
|
||||
* 7234</a>
|
||||
*/
|
||||
public String expires() {
|
||||
public static String expires() {
|
||||
return "Expires";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code From} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.5.1" > Section 5.5.1 of
|
||||
* @return The HTTP {@code From} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.5.1">Section 5.5.1 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String from() {
|
||||
public static String from() {
|
||||
return "From";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Host} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-5.4" > Section 5.4 of RFC
|
||||
* @return The HTTP {@code Host} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-5.4">Section 5.4 of RFC
|
||||
* 7230</a>
|
||||
*/
|
||||
public String host() {
|
||||
public static String host() {
|
||||
return "Host";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Match} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.1" > Section 3.1 of RFC
|
||||
* @return The HTTP {@code If-Match} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-3.1">Section 3.1 of RFC
|
||||
* 7232</a>
|
||||
*/
|
||||
public String ifMatch() {
|
||||
public static String ifMatch() {
|
||||
return "If-Match";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Modified-Since} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.3" > Section 3.3 of RFC
|
||||
* @return The HTTP {@code If-Modified-Since} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-3.3">Section 3.3 of RFC
|
||||
* 7232</a>
|
||||
*/
|
||||
public String ifModifiedSince() {
|
||||
public static String ifModifiedSince() {
|
||||
return "If-Modified-Since";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-None-Match} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.2" > Section 3.2 of RFC
|
||||
* @return The HTTP {@code If-None-Match} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-3.2">Section 3.2 of RFC
|
||||
* 7232</a>
|
||||
*/
|
||||
public String ifNoneMatch() {
|
||||
public static String ifNoneMatch() {
|
||||
return "If-None-Match";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Range} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-3.2" > Section 3.2 of RFC
|
||||
* @return The HTTP {@code If-Range} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7233#section-3.2">Section 3.2 of RFC
|
||||
* 7233</a>
|
||||
*/
|
||||
public String ifRange() {
|
||||
public static String ifRange() {
|
||||
return "If-Range";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code If-Unmodified-Since} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-3.4" > Section 3.4 of RFC
|
||||
* @return The HTTP {@code If-Unmodified-Since} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-3.4">Section 3.4 of RFC
|
||||
* 7232</a>
|
||||
*/
|
||||
public String ifUnmodifiedSince() {
|
||||
public static String ifUnmodifiedSince() {
|
||||
return "If-Unmodified-Since";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Last-Modified} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-2.2" > Section 2.2 of RFC
|
||||
* @return The HTTP {@code Last-Modified} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-2.2">Section 2.2 of RFC
|
||||
* 7232</a>
|
||||
*/
|
||||
public String lastModified() {
|
||||
public static String lastModified() {
|
||||
return "Last-Modified";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Link} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc5988" > RFC 5988</a>
|
||||
* @return The HTTP {@code Link} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5988">RFC 5988</a>
|
||||
*/
|
||||
public String link() {
|
||||
public static String link() {
|
||||
return "Link";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Location} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.2" > Section 7.1.2 of
|
||||
* @return The HTTP {@code Location} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.2">Section 7.1.2 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String location() {
|
||||
public static String location() {
|
||||
return "Location";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Max-Forwards} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.1.2" > Section 5.1.2 of
|
||||
* @return The HTTP {@code Max-Forwards} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.1.2">Section 5.1.2 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String max_forwards() {
|
||||
public static String max_forwards() {
|
||||
return "Max-Forwards";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Origin} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6454" > RFC 6454</a>
|
||||
* @return The HTTP {@code Origin} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6454">RFC 6454</a>
|
||||
*/
|
||||
public String origin() {
|
||||
public static String origin() {
|
||||
return "Origin";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Pragma} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.4" > Section 5.4 of RFC
|
||||
* @return The HTTP {@code Pragma} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.4">Section 5.4 of RFC
|
||||
* 7234</a>
|
||||
*/
|
||||
public String pragma() {
|
||||
public static String pragma() {
|
||||
return "Pragma";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Proxy-Authenticate} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.3" > Section 4.3 of RFC
|
||||
* @return The HTTP {@code Proxy-Authenticate} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7235#section-4.3">Section 4.3 of RFC
|
||||
* 7235</a>
|
||||
*/
|
||||
public String proxyAuthenticate() {
|
||||
public static String proxyAuthenticate() {
|
||||
return "Proxy-Authenticate";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Proxy-Authorization} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.4" > Section 4.4 of RFC
|
||||
* @return The HTTP {@code Proxy-Authorization} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7235#section-4.4">Section 4.4 of RFC
|
||||
* 7235</a>
|
||||
*/
|
||||
public String proxyAuthorization() {
|
||||
public static String proxyAuthorization() {
|
||||
return "Proxy-Authorization";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Range} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-3.1" > Section 3.1 of RFC
|
||||
* @return The HTTP {@code Range} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7233#section-3.1">Section 3.1 of RFC
|
||||
* 7233</a>
|
||||
*/
|
||||
public String range() {
|
||||
public static String range() {
|
||||
return "Range";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Referer} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.5.2" > Section 5.5.2 of
|
||||
* @return The HTTP {@code Referer} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.5.2">Section 5.5.2 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String referer() {
|
||||
public static String referer() {
|
||||
return "Referer";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Retry-After} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.3" > Section 7.1.3 of
|
||||
* @return The HTTP {@code Retry-After} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.3">Section 7.1.3 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String retryAfter() {
|
||||
public static String retryAfter() {
|
||||
return "Retry-After";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Server} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.4.2" > Section 7.4.2 of
|
||||
* @return The HTTP {@code Server} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.4.2">Section 7.4.2 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String server() {
|
||||
public static String server() {
|
||||
return "Server";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Set-Cookie} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2109#section-4.2.2" > Section 4.2.2 of
|
||||
* @return The HTTP {@code Set-Cookie} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2109#section-4.2.2">Section 4.2.2 of
|
||||
* RFC 2109</a>
|
||||
*/
|
||||
public String setCookie() {
|
||||
public static String setCookie() {
|
||||
return "Set-Cookie";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Set-Cookie2} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2965" > RFC 2965</a>
|
||||
* @return The HTTP {@code Set-Cookie2} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2965">RFC 2965</a>
|
||||
*/
|
||||
public String setCookie2() {
|
||||
public static String setCookie2() {
|
||||
return "Set-Cookie2";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code TE} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-4.3" > Section 4.3 of RFC
|
||||
* @return The HTTP {@code TE} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-4.3">Section 4.3 of RFC
|
||||
* 7230</a>
|
||||
*/
|
||||
public String te() {
|
||||
public static String te() {
|
||||
return "TE";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Trailer} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-4.4" > Section 4.4 of RFC
|
||||
* @return The HTTP {@code Trailer} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-4.4">Section 4.4 of RFC
|
||||
* 7230</a>
|
||||
*/
|
||||
public String trailer() {
|
||||
public static String trailer() {
|
||||
return "Trailer";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Transfer-Encoding} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-3.3.1" > Section 3.3.1 of
|
||||
* @return The HTTP {@code Transfer-Encoding} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3.1">Section 3.3.1 of
|
||||
* RFC 7230</a>
|
||||
*/
|
||||
public String transferEncoding() {
|
||||
public static String transferEncoding() {
|
||||
return "Transfer-Encoding";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Upgrade} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-6.7" > Section 6.7 of RFC
|
||||
* @return The HTTP {@code Upgrade} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-6.7">Section 6.7 of RFC
|
||||
* 7230</a>
|
||||
*/
|
||||
public String upgrade() {
|
||||
public static String upgrade() {
|
||||
return "Upgrade";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code User-Agent} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-5.5.3" > Section 5.5.3 of
|
||||
* @return The HTTP {@code User-Agent} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-5.5.3">Section 5.5.3 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String user_agent() {
|
||||
public static String user_agent() {
|
||||
return "User-Agent";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Vary} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-7.1.4" > Section 7.1.4 of
|
||||
* @return The HTTP {@code Vary} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.4">Section 7.1.4 of
|
||||
* RFC 7231</a>
|
||||
*/
|
||||
public String vary() {
|
||||
public static String vary() {
|
||||
return "Vary";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Via} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7230#section-5.7.1" > Section 5.7.1 of
|
||||
* @return The HTTP {@code Via} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7230#section-5.7.1">Section 5.7.1 of
|
||||
* RFC 7230</a>
|
||||
*/
|
||||
public String via() {
|
||||
public static String via() {
|
||||
return "Via";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code Warning} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7234#section-5.5" > Section 5.5 of RFC
|
||||
* @return The HTTP {@code Warning} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7234#section-5.5">Section 5.5 of RFC
|
||||
* 7234</a>
|
||||
*/
|
||||
public String warning() {
|
||||
public static String warning() {
|
||||
return "Warning";
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP {@code WWW-Authenticate} header field name.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-4.1" > Section 4.1 of RFC
|
||||
* @return The HTTP {@code WWW-Authenticate} header field name.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7235#section-4.1">Section 4.1 of RFC
|
||||
* 7235</a>
|
||||
*/
|
||||
public String wwwAuthenticate() {
|
||||
public static String wwwAuthenticate() {
|
||||
return "WWW-Authenticate";
|
||||
}
|
||||
|
||||
|
||||
@@ -20,39 +20,68 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
* Contains Http Methods.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.2
|
||||
*/
|
||||
public class HttpMethods {
|
||||
public final class HttpMethods {
|
||||
|
||||
public HttpMethod GET() {
|
||||
public HttpMethods() {
|
||||
System.out.println("WARNING: HttpMethods shouldn't be instantiated");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code GET}.
|
||||
*/
|
||||
public static HttpMethod GET() {
|
||||
return HttpMethod.GET;
|
||||
}
|
||||
|
||||
public HttpMethod HEAD() {
|
||||
/**
|
||||
* @return {@code HEAD}.
|
||||
*/
|
||||
public static HttpMethod HEAD() {
|
||||
return HttpMethod.HEAD;
|
||||
}
|
||||
|
||||
public HttpMethod POST() {
|
||||
/**
|
||||
* @return {@code POST}.
|
||||
*/
|
||||
public static HttpMethod POST() {
|
||||
return HttpMethod.POST;
|
||||
}
|
||||
|
||||
public HttpMethod PUT() {
|
||||
/**
|
||||
* @return {@code PUT}.
|
||||
*/
|
||||
public static HttpMethod PUT() {
|
||||
return HttpMethod.PUT;
|
||||
}
|
||||
|
||||
public HttpMethod PATCH() {
|
||||
/**
|
||||
* @return {@code PATCH}.
|
||||
*/
|
||||
public static HttpMethod PATCH() {
|
||||
return HttpMethod.PATCH;
|
||||
}
|
||||
|
||||
public HttpMethod DELETE() {
|
||||
/**
|
||||
* @return {@code DELETE}.
|
||||
*/
|
||||
public static HttpMethod DELETE() {
|
||||
return HttpMethod.DELETE;
|
||||
}
|
||||
|
||||
public HttpMethod OPTIONS() {
|
||||
/**
|
||||
* @return {@code OPTIONS}.
|
||||
*/
|
||||
public static HttpMethod OPTIONS() {
|
||||
return HttpMethod.OPTIONS;
|
||||
}
|
||||
|
||||
public HttpMethod TRACE() {
|
||||
/**
|
||||
* @return {@code TRACE}.
|
||||
*/
|
||||
public static HttpMethod TRACE() {
|
||||
return HttpMethod.TRACE;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,615 +20,620 @@ package org.springframework.cloud.contract.spec.internal;
|
||||
* Helper functions for HTTP statuses.
|
||||
*
|
||||
* @author Marcin Grzejszczak
|
||||
* @author Tim Ysewyn
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class HttpStatus {
|
||||
public final class HttpStatus {
|
||||
|
||||
public HttpStatus() {
|
||||
System.out.println("WARNING: HttpStatus shouldn't be instantiated");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 100 Continue}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.2.1" > HTTP/1.1:
|
||||
* @return {@code 100 Continue}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.2.1">HTTP/1.1:
|
||||
* Semantics and Content, section 6.2.1</a>
|
||||
*/
|
||||
public int CONTINUE() {
|
||||
public static int CONTINUE() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 101 Switching Protocols}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.2.2" > HTTP/1.1:
|
||||
* @return {@code 101 Switching Protocols}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.2.2">HTTP/1.1:
|
||||
* Semantics and Content, section 6.2.2</a>
|
||||
*/
|
||||
public int SWITCHING_PROTOCOLS() {
|
||||
public static int SWITCHING_PROTOCOLS() {
|
||||
return 101;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 102 Processing}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2518#section-10.1" > WebDAV</a>
|
||||
* @return {@code 102 Processing}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2518#section-10.1">WebDAV</a>
|
||||
*/
|
||||
public int PROCESSING() {
|
||||
public static int PROCESSING() {
|
||||
return 102;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 103 Checkpoint}.
|
||||
* @see <ahref="https://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal" >
|
||||
* @return {@code 103 Checkpoint}.
|
||||
* @see <a href="https://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal" >
|
||||
* A proposal for supporting resumable POST/PUT HTTP requests in HTTP/1.0</a>
|
||||
*/
|
||||
public int CHECKPOINT() {
|
||||
public static int CHECKPOINT() {
|
||||
return 103;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 200 OK}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.1" > HTTP/1.1:
|
||||
* @return {@code 200 OK}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.3.1">HTTP/1.1:
|
||||
* Semantics and Content, section 6.3.1</a>
|
||||
*/
|
||||
public int OK() {
|
||||
public static int OK() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 201 Created}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.2" > HTTP/1.1:
|
||||
* @return {@code 201 Created}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.3.2">HTTP/1.1:
|
||||
* Semantics and Content, section 6.3.2</a>
|
||||
*/
|
||||
public int CREATED() {
|
||||
public static int CREATED() {
|
||||
return 201;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 202 Accepted}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.3" > HTTP/1.1:
|
||||
* @return {@code 202 Accepted}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.3.3">HTTP/1.1:
|
||||
* Semantics and Content, section 6.3.3</a>
|
||||
*/
|
||||
public int ACCEPTED() {
|
||||
public static int ACCEPTED() {
|
||||
return 202;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 203 Non-Authoritative Information}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.4" > HTTP/1.1:
|
||||
* @return {@code 203 Non-Authoritative Information}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.3.4">HTTP/1.1:
|
||||
* Semantics and Content, section 6.3.4</a>
|
||||
*/
|
||||
public int NON_AUTHORITATIVE_INFORMATION() {
|
||||
public static int NON_AUTHORITATIVE_INFORMATION() {
|
||||
return 203;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 204 No Content}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.5" > HTTP/1.1:
|
||||
* @return {@code 204 No Content}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.3.5">HTTP/1.1:
|
||||
* Semantics and Content, section 6.3.5</a>
|
||||
*/
|
||||
public int NO_CONTENT() {
|
||||
public static int NO_CONTENT() {
|
||||
return 204;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 205 Reset Content}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.3.6" > HTTP/1.1:
|
||||
* @return {@code 205 Reset Content}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.3.6">HTTP/1.1:
|
||||
* Semantics and Content, section 6.3.6</a>
|
||||
*/
|
||||
public int RESET_CONTENT() {
|
||||
public static int RESET_CONTENT() {
|
||||
return 205;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 206 Partial Content}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-4.1" > HTTP/1.1: Range
|
||||
* @return {@code 206 Partial Content}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7233#section-4.1">HTTP/1.1: Range
|
||||
* Requests, section 4.1</a>
|
||||
*/
|
||||
public int PARTIAL_CONTENT() {
|
||||
public static int PARTIAL_CONTENT() {
|
||||
return 206;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 207 Multi-Status}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-13" > WebDAV</a>
|
||||
* @return {@code 207 Multi-Status}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc4918#section-13">WebDAV</a>
|
||||
*/
|
||||
public int MULTI_STATUS() {
|
||||
public static int MULTI_STATUS() {
|
||||
return 207;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 208 Already Reported}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc5842#section-7.1" > WebDAV Binding
|
||||
* @return {@code 208 Already Reported}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5842#section-7.1">WebDAV Binding
|
||||
* Extensions</a>
|
||||
*/
|
||||
public int ALREADY_REPORTED() {
|
||||
public static int ALREADY_REPORTED() {
|
||||
return 208;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 226 IM Used}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc3229#section-10.4.1" > Delta encoding
|
||||
* in HTTP</a>
|
||||
* @return {@code 226 IM Used}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc3229#section-10.4.1">Delta encoding in
|
||||
* HTTP</a>
|
||||
*/
|
||||
public int IM_USED() {
|
||||
public static int IM_USED() {
|
||||
return 226;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 300 Multiple Choices}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.1" > HTTP/1.1:
|
||||
* @return {@code 300 Multiple Choices}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.4.1">HTTP/1.1:
|
||||
* Semantics and Content, section 6.4.1</a>
|
||||
*/
|
||||
public int MULTIPLE_CHOICES() {
|
||||
public static int MULTIPLE_CHOICES() {
|
||||
return 300;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 301 Moved Permanently}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.2" > HTTP/1.1:
|
||||
* @return {@code 301 Moved Permanently}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.4.2">HTTP/1.1:
|
||||
* Semantics and Content, section 6.4.2</a>
|
||||
*/
|
||||
public int MOVED_PERMANENTLY() {
|
||||
public static int MOVED_PERMANENTLY() {
|
||||
return 301;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 302 Found}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.3" > HTTP/1.1:
|
||||
* @return {@code 302 Found}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.4.3">HTTP/1.1:
|
||||
* Semantics and Content, section 6.4.3</a>
|
||||
*/
|
||||
public int FOUND() {
|
||||
public static int FOUND() {
|
||||
return 302;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 302 Moved Temporarily}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc1945#section-9.3" > HTTP/1.0, section
|
||||
* @return {@code 302 Moved Temporarily}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc1945#section-9.3">HTTP/1.0, section
|
||||
* 9.3</a>
|
||||
* @deprecated in favor of {@link #FOUND} which will be returned from
|
||||
* {@code HttpStatus.valueOf(302)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int MOVED_TEMPORARILY() {
|
||||
public static int MOVED_TEMPORARILY() {
|
||||
return 302;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 303 See Other}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.4" > HTTP/1.1:
|
||||
* @return {@code 303 See Other}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.4.4">HTTP/1.1:
|
||||
* Semantics and Content, section 6.4.4</a>
|
||||
*/
|
||||
public int SEE_OTHER() {
|
||||
public static int SEE_OTHER() {
|
||||
return 303;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 304 Not Modified}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-4.1" > HTTP/1.1:
|
||||
* @return {@code 304 Not Modified}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-4.1">HTTP/1.1:
|
||||
* Conditional Requests, section 4.1</a>
|
||||
*/
|
||||
public int NOT_MODIFIED() {
|
||||
public static int NOT_MODIFIED() {
|
||||
return 304;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 305 Use Proxy}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.5" > HTTP/1.1:
|
||||
* @return {@code 305 Use Proxy}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.4.5">HTTP/1.1:
|
||||
* Semantics and Content, section 6.4.5</a>
|
||||
* @deprecated due to security concerns regarding in-band configuration of a proxy
|
||||
*/
|
||||
@Deprecated
|
||||
public int USE_PROXY() {
|
||||
public static int USE_PROXY() {
|
||||
return 305;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 307 Temporary Redirect}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.4.7" > HTTP/1.1:
|
||||
* @return {@code 307 Temporary Redirect}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.4.7">HTTP/1.1:
|
||||
* Semantics and Content, section 6.4.7</a>
|
||||
*/
|
||||
public int TEMPORARY_REDIRECT() {
|
||||
public static int TEMPORARY_REDIRECT() {
|
||||
return 307;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 308 Permanent Redirect}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7238" > RFC 7238</a>
|
||||
* @return {@code 308 Permanent Redirect}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7238">RFC 7238</a>
|
||||
*/
|
||||
public int PERMANENT_REDIRECT() {
|
||||
public static int PERMANENT_REDIRECT() {
|
||||
return 308;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 400 Bad Request}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.1" > HTTP/1.1:
|
||||
* @return {@code 400 Bad Request}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.1">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.1</a>
|
||||
*/
|
||||
public int BAD_REQUEST() {
|
||||
public static int BAD_REQUEST() {
|
||||
return 400;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 401 Unauthorized}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-3.1" > HTTP/1.1:
|
||||
* @return {@code 401 Unauthorized}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7235#section-3.1">HTTP/1.1:
|
||||
* Authentication, section 3.1</a>
|
||||
*/
|
||||
public int UNAUTHORIZED() {
|
||||
public static int UNAUTHORIZED() {
|
||||
return 401;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 402 Payment Required}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.2" > HTTP/1.1:
|
||||
* @return {@code 402 Payment Required}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.2">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.2</a>
|
||||
*/
|
||||
public int PAYMENT_REQUIRED() {
|
||||
public static int PAYMENT_REQUIRED() {
|
||||
return 402;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 403 Forbidden}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.3" > HTTP/1.1:
|
||||
* @return {@code 403 Forbidden}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.3">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.3</a>
|
||||
*/
|
||||
public int FORBIDDEN() {
|
||||
public static int FORBIDDEN() {
|
||||
return 403;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 404 Not Found}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.4" > HTTP/1.1:
|
||||
* @return {@code 404 Not Found}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.4">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.4</a>
|
||||
*/
|
||||
public int NOT_FOUND() {
|
||||
public static int NOT_FOUND() {
|
||||
return 404;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 405 Method Not Allowed}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.5" > HTTP/1.1:
|
||||
* @return {@code 405 Method Not Allowed}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.5">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.5</a>
|
||||
*/
|
||||
public int METHOD_NOT_ALLOWED() {
|
||||
public static int METHOD_NOT_ALLOWED() {
|
||||
return 405;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 406 Not Acceptable}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.6" > HTTP/1.1:
|
||||
* @return {@code 406 Not Acceptable}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.6">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.6</a>
|
||||
*/
|
||||
public int NOT_ACCEPTABLE() {
|
||||
public static int NOT_ACCEPTABLE() {
|
||||
return 406;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 407 Proxy Authentication Required}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7235#section-3.2" > HTTP/1.1:
|
||||
* @return {@code 407 Proxy Authentication Required}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7235#section-3.2">HTTP/1.1:
|
||||
* Authentication, section 3.2</a>
|
||||
*/
|
||||
public int PROXY_AUTHENTICATION_REQUIRED() {
|
||||
public static int PROXY_AUTHENTICATION_REQUIRED() {
|
||||
return 407;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 408 Request Timeout}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.7" > HTTP/1.1:
|
||||
* @return {@code 408 Request Timeout}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.7">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.7</a>
|
||||
*/
|
||||
public int REQUEST_TIMEOUT() {
|
||||
public static int REQUEST_TIMEOUT() {
|
||||
return 408;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 409 Conflict}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.8" > HTTP/1.1:
|
||||
* @return {@code 409 Conflict}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.8">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.8</a>
|
||||
*/
|
||||
public int CONFLICT() {
|
||||
public static int CONFLICT() {
|
||||
return 409;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 410 Gone}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.9" > HTTP/1.1:
|
||||
* @return {@code 410 Gone}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.9">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.9</a>
|
||||
*/
|
||||
public int GONE() {
|
||||
public static int GONE() {
|
||||
return 410;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 411 Length Required}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.10" > HTTP/1.1:
|
||||
* @return {@code 411 Length Required}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.10">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.10</a>
|
||||
*/
|
||||
public int LENGTH_REQUIRED() {
|
||||
public static int LENGTH_REQUIRED() {
|
||||
return 411;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 412 Precondition failed}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7232#section-4.2" > HTTP/1.1:
|
||||
* @return {@code 412 Precondition failed}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7232#section-4.2">HTTP/1.1:
|
||||
* Conditional Requests, section 4.2</a>
|
||||
*/
|
||||
public int PRECONDITION_FAILED() {
|
||||
public static int PRECONDITION_FAILED() {
|
||||
return 412;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 413 Payload Too Large}.
|
||||
* @since 4.1* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.11" >
|
||||
* @return {@code 413 Payload Too Large}.
|
||||
* @since 4.1* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.11" >
|
||||
* HTTP/1.1: Semantics and Content, section 6.5.11</a>
|
||||
*/
|
||||
public int PAYLOAD_TOO_LARGE() {
|
||||
public static int PAYLOAD_TOO_LARGE() {
|
||||
return 413;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 413 Request Entity Too Large}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2616#section-10.4.14" > HTTP/1.1,
|
||||
* @return {@code 413 Request Entity Too Large}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2616#section-10.4.14">HTTP/1.1,
|
||||
* section 10.4.14</a>
|
||||
* @deprecated in favor of {@link #PAYLOAD_TOO_LARGE} which will be returned from
|
||||
* {@code HttpStatus.valueOf(413)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int REQUEST_ENTITY_TOO_LARGE() {
|
||||
public static int REQUEST_ENTITY_TOO_LARGE() {
|
||||
return 413;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 414 URI Too Long}.
|
||||
* @since 4.1* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.12" >
|
||||
* @return {@code 414 URI Too Long}.
|
||||
* @since 4.1* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.12" >
|
||||
* HTTP/1.1: Semantics and Content, section 6.5.12</a>
|
||||
*/
|
||||
public int URI_TOO_LONG() {
|
||||
public static int URI_TOO_LONG() {
|
||||
return 414;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 414 Request-URI Too Long}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2616#section-10.4.15" > HTTP/1.1,
|
||||
* @return {@code 414 Request-URI Too Long}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2616#section-10.4.15">HTTP/1.1,
|
||||
* section 10.4.15</a>
|
||||
* @deprecated in favor of {@link #URI_TOO_LONG} which will be returned from
|
||||
* {@code HttpStatus.valueOf(414)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int REQUEST_URI_TOO_LONG() {
|
||||
public static int REQUEST_URI_TOO_LONG() {
|
||||
return 414;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 415 Unsupported Media Type}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.13" > HTTP/1.1:
|
||||
* @return {@code 415 Unsupported Media Type}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.13">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.13</a>
|
||||
*/
|
||||
public int UNSUPPORTED_MEDIA_TYPE() {
|
||||
public static int UNSUPPORTED_MEDIA_TYPE() {
|
||||
return 415;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 416 Requested Range Not Satisfiable}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7233#section-4.4" > HTTP/1.1: Range
|
||||
* @return {@code 416 Requested Range Not Satisfiable}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7233#section-4.4">HTTP/1.1: Range
|
||||
* Requests, section 4.4</a>
|
||||
*/
|
||||
public int REQUESTED_RANGE_NOT_SATISFIABLE() {
|
||||
public static int REQUESTED_RANGE_NOT_SATISFIABLE() {
|
||||
return 416;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 417 Expectation Failed}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.5.14" > HTTP/1.1:
|
||||
* @return {@code 417 Expectation Failed}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.5.14">HTTP/1.1:
|
||||
* Semantics and Content, section 6.5.14</a>
|
||||
*/
|
||||
public int EXPECTATION_FAILED() {
|
||||
public static int EXPECTATION_FAILED() {
|
||||
return 417;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 418 I'm a teapot}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2324#section-2.3.2" > HTCPCP/1.0</a>
|
||||
* @return {@code 418 I'm a teapot}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2324#section-2.3.2">HTCPCP/1.0</a>
|
||||
*/
|
||||
public int I_AM_A_TEAPOT() {
|
||||
public static int I_AM_A_TEAPOT() {
|
||||
return 418;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code 419 Insufficient Space}.
|
||||
* @deprecated See <a href=
|
||||
* "https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV
|
||||
* Draft Changes</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public int INSUFFICIENT_SPACE_ON_RESOURCE() {
|
||||
public static int INSUFFICIENT_SPACE_ON_RESOURCE() {
|
||||
return 419;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code 420 Method Failure}.
|
||||
* @deprecated See <a href=
|
||||
* "https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV
|
||||
* Draft Changes</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public int METHOD_FAILURE() {
|
||||
public static int METHOD_FAILURE() {
|
||||
return 420;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code 421 Destination Locked}.
|
||||
* @deprecated See <a href=
|
||||
* "https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt">WebDAV
|
||||
* Draft Changes</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public int DESTINATION_LOCKED() {
|
||||
public static int DESTINATION_LOCKED() {
|
||||
return 421;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 422 Unprocessable Entity}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.2" > WebDAV</a>
|
||||
* @return {@code 422 Unprocessable Entity}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc4918#section-11.2">WebDAV</a>
|
||||
*/
|
||||
public int UNPROCESSABLE_ENTITY() {
|
||||
public static int UNPROCESSABLE_ENTITY() {
|
||||
return 422;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 423 Locked}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.3" > WebDAV</a>
|
||||
* @return {@code 423 Locked}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc4918#section-11.3">WebDAV</a>
|
||||
*/
|
||||
public int LOCKED() {
|
||||
public static int LOCKED() {
|
||||
return 423;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 424 Failed Dependency}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.4" > WebDAV</a>
|
||||
* @return {@code 424 Failed Dependency}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc4918#section-11.4">WebDAV</a>
|
||||
*/
|
||||
public int FAILED_DEPENDENCY() {
|
||||
public static int FAILED_DEPENDENCY() {
|
||||
return 424;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 426 Upgrade Required}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2817#section-6" > Upgrading to TLS
|
||||
* @return {@code 426 Upgrade Required}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2817#section-6">Upgrading to TLS
|
||||
* Within HTTP/1.1</a>
|
||||
*/
|
||||
public int UPGRADE_REQUIRED() {
|
||||
public static int UPGRADE_REQUIRED() {
|
||||
return 426;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 428 Precondition Required}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-3" > Additional HTTP
|
||||
* Status Codes</a>
|
||||
* @return {@code 428 Precondition Required}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6585#section-3">Additional HTTP Status
|
||||
* Codes</a>
|
||||
*/
|
||||
public int PRECONDITION_REQUIRED() {
|
||||
public static int PRECONDITION_REQUIRED() {
|
||||
return 428;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 429 Too Many Requests}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-4" > Additional HTTP
|
||||
* Status Codes</a>
|
||||
* @return {@code 429 Too Many Requests}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6585#section-4">Additional HTTP Status
|
||||
* Codes</a>
|
||||
*/
|
||||
public int TOO_MANY_REQUESTS() {
|
||||
public static int TOO_MANY_REQUESTS() {
|
||||
return 429;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 431 Request Header Fields Too Large}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-5" > Additional HTTP
|
||||
* Status Codes</a>
|
||||
* @return {@code 431 Request Header Fields Too Large}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6585#section-5">Additional HTTP Status
|
||||
* Codes</a>
|
||||
*/
|
||||
public int REQUEST_HEADER_FIELDS_TOO_LARGE() {
|
||||
public static int REQUEST_HEADER_FIELDS_TOO_LARGE() {
|
||||
return 431;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 451 Unavailable For Legal Reasons}.
|
||||
* @see <ahref="https://tools.ietf.org/html/draft-ietf-httpbis-legally-restricted-status-04"
|
||||
* > An HTTP Status Code to Report Legal Obstacles</a>
|
||||
* @since 4.3
|
||||
* @return {@code 451 Unavailable For Legal Reasons}.
|
||||
* @see <a href=
|
||||
* "https://tools.ietf.org/html/draft-ietf-httpbis-legally-restricted-status-04" > An
|
||||
* HTTP Status Code to Report Legal Obstacles</a>
|
||||
*/
|
||||
public int UNAVAILABLE_FOR_LEGAL_REASONS() {
|
||||
public static int UNAVAILABLE_FOR_LEGAL_REASONS() {
|
||||
return 451;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 500 Internal Server Error}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.1" > HTTP/1.1:
|
||||
* @return {@code 500 Internal Server Error}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.6.1">HTTP/1.1:
|
||||
* Semantics and Content, section 6.6.1</a>
|
||||
*/
|
||||
public int INTERNAL_SERVER_ERROR() {
|
||||
public static int INTERNAL_SERVER_ERROR() {
|
||||
return 500;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 501 Not Implemented}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.2" > HTTP/1.1:
|
||||
* @return {@code 501 Not Implemented}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.6.2">HTTP/1.1:
|
||||
* Semantics and Content, section 6.6.2</a>
|
||||
*/
|
||||
public int NOT_IMPLEMENTED() {
|
||||
public static int NOT_IMPLEMENTED() {
|
||||
return 501;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 502 Bad Gateway}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.3" > HTTP/1.1:
|
||||
* @return {@code 502 Bad Gateway}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.6.3">HTTP/1.1:
|
||||
* Semantics and Content, section 6.6.3</a>
|
||||
*/
|
||||
public int BAD_GATEWAY() {
|
||||
public static int BAD_GATEWAY() {
|
||||
return 502;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 503 Service Unavailable}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.4" > HTTP/1.1:
|
||||
* @return {@code 503 Service Unavailable}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.6.4">HTTP/1.1:
|
||||
* Semantics and Content, section 6.6.4</a>
|
||||
*/
|
||||
public int SERVICE_UNAVAILABLE() {
|
||||
public static int SERVICE_UNAVAILABLE() {
|
||||
return 503;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 504 Gateway Timeout}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.5" > HTTP/1.1:
|
||||
* @return {@code 504 Gateway Timeout}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.6.5">HTTP/1.1:
|
||||
* Semantics and Content, section 6.6.5</a>
|
||||
*/
|
||||
public int GATEWAY_TIMEOUT() {
|
||||
public static int GATEWAY_TIMEOUT() {
|
||||
return 504;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 505 HTTP Version Not Supported}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc7231#section-6.6.6" > HTTP/1.1:
|
||||
* @return {@code 505 HTTP Version Not Supported}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-6.6.6">HTTP/1.1:
|
||||
* Semantics and Content, section 6.6.6</a>
|
||||
*/
|
||||
public int HTTP_VERSION_NOT_SUPPORTED() {
|
||||
public static int HTTP_VERSION_NOT_SUPPORTED() {
|
||||
return 505;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 506 Variant Also Negotiates}
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2295#section-8.1" > Transparent Content
|
||||
* @return {@code 506 Variant Also Negotiates}
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2295#section-8.1">Transparent Content
|
||||
* Negotiation</a>
|
||||
*/
|
||||
public int VARIANT_ALSO_NEGOTIATES() {
|
||||
public static int VARIANT_ALSO_NEGOTIATES() {
|
||||
return 506;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 507 Insufficient Storage}
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc4918#section-11.5" > WebDAV</a>
|
||||
* @return {@code 507 Insufficient Storage}
|
||||
* @see <a href="https://tools.ietf.org/html/rfc4918#section-11.5">WebDAV</a>
|
||||
*/
|
||||
public int INSUFFICIENT_STORAGE() {
|
||||
public static int INSUFFICIENT_STORAGE() {
|
||||
return 507;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 508 Loop Detected}
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc5842#section-7.2" > WebDAV Binding
|
||||
* @return {@code 508 Loop Detected}
|
||||
* @see <a href="https://tools.ietf.org/html/rfc5842#section-7.2">WebDAV Binding
|
||||
* Extensions</a>
|
||||
*/
|
||||
public int LOOP_DETECTED() {
|
||||
public static int LOOP_DETECTED() {
|
||||
return 508;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 509 Bandwidth Limit Exceeded}
|
||||
* @return {@code 509 Bandwidth Limit Exceeded}
|
||||
*/
|
||||
public int BANDWIDTH_LIMIT_EXCEEDED() {
|
||||
public static int BANDWIDTH_LIMIT_EXCEEDED() {
|
||||
return 509;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 510 Not Extended}
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc2774#section-7" > HTTP Extension
|
||||
* @return {@code 510 Not Extended}
|
||||
* @see <a href="https://tools.ietf.org/html/rfc2774#section-7">HTTP Extension
|
||||
* Framework</a>
|
||||
*/
|
||||
public int NOT_EXTENDED() {
|
||||
public static int NOT_EXTENDED() {
|
||||
return 510;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code 511 Network Authentication Required}.
|
||||
* @see <ahref="https://tools.ietf.org/html/rfc6585#section-6" > Additional HTTP
|
||||
* Status Codes</a>
|
||||
* @return {@code 511 Network Authentication Required}.
|
||||
* @see <a href="https://tools.ietf.org/html/rfc6585#section-6">Additional HTTP Status
|
||||
* Codes</a>
|
||||
*/
|
||||
public int NETWORK_AUTHENTICATION_REQUIRED() {
|
||||
public static int NETWORK_AUTHENTICATION_REQUIRED() {
|
||||
return 511;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,12 @@ import java.util.stream.Collectors;
|
||||
* @author Tim Ysewyn
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class RegexPatterns {
|
||||
public final class RegexPatterns {
|
||||
|
||||
public RegexPatterns() {
|
||||
System.out.println("WARNING: RegexPatterns shouldn't be instantiated");
|
||||
}
|
||||
|
||||
// tag::regexps[]
|
||||
protected static final Pattern TRUE_OR_FALSE = Pattern.compile("(true|false)");
|
||||
|
||||
protected static final Pattern ALPHA_NUMERIC = Pattern.compile("[a-zA-Z0-9]+");
|
||||
@@ -108,82 +111,84 @@ public class RegexPatterns {
|
||||
return contentType.toString();
|
||||
}
|
||||
|
||||
public RegexProperty onlyAlphaUnicode() {
|
||||
// tag::regexps[]
|
||||
|
||||
public static RegexProperty onlyAlphaUnicode() {
|
||||
return new RegexProperty(ONLY_ALPHA_UNICODE).asString();
|
||||
}
|
||||
|
||||
public RegexProperty alphaNumeric() {
|
||||
public static RegexProperty alphaNumeric() {
|
||||
return new RegexProperty(ALPHA_NUMERIC).asString();
|
||||
}
|
||||
|
||||
public RegexProperty number() {
|
||||
public static RegexProperty number() {
|
||||
return new RegexProperty(NUMBER).asDouble();
|
||||
}
|
||||
|
||||
public RegexProperty positiveInt() {
|
||||
public static RegexProperty positiveInt() {
|
||||
return new RegexProperty(POSITIVE_INT).asInteger();
|
||||
}
|
||||
|
||||
public RegexProperty anyBoolean() {
|
||||
public static RegexProperty anyBoolean() {
|
||||
return new RegexProperty(TRUE_OR_FALSE).asBooleanType();
|
||||
}
|
||||
|
||||
public RegexProperty anInteger() {
|
||||
public static RegexProperty anInteger() {
|
||||
return new RegexProperty(INTEGER).asInteger();
|
||||
}
|
||||
|
||||
public RegexProperty aDouble() {
|
||||
public static RegexProperty aDouble() {
|
||||
return new RegexProperty(DOUBLE).asDouble();
|
||||
}
|
||||
|
||||
public RegexProperty ipAddress() {
|
||||
public static RegexProperty ipAddress() {
|
||||
return new RegexProperty(IP_ADDRESS).asString();
|
||||
}
|
||||
|
||||
public RegexProperty hostname() {
|
||||
public static RegexProperty hostname() {
|
||||
return new RegexProperty(HOSTNAME_PATTERN).asString();
|
||||
}
|
||||
|
||||
public RegexProperty email() {
|
||||
public static RegexProperty email() {
|
||||
return new RegexProperty(EMAIL).asString();
|
||||
}
|
||||
|
||||
public RegexProperty url() {
|
||||
public static RegexProperty url() {
|
||||
return new RegexProperty(URL).asString();
|
||||
}
|
||||
|
||||
public RegexProperty httpsUrl() {
|
||||
public static RegexProperty httpsUrl() {
|
||||
return new RegexProperty(HTTPS_URL).asString();
|
||||
}
|
||||
|
||||
public RegexProperty uuid() {
|
||||
public static RegexProperty uuid() {
|
||||
return new RegexProperty(UUID).asString();
|
||||
}
|
||||
|
||||
public RegexProperty isoDate() {
|
||||
public static RegexProperty isoDate() {
|
||||
return new RegexProperty(ANY_DATE).asString();
|
||||
}
|
||||
|
||||
public RegexProperty isoDateTime() {
|
||||
public static RegexProperty isoDateTime() {
|
||||
return new RegexProperty(ANY_DATE_TIME).asString();
|
||||
}
|
||||
|
||||
public RegexProperty isoTime() {
|
||||
public static RegexProperty isoTime() {
|
||||
return new RegexProperty(ANY_TIME).asString();
|
||||
}
|
||||
|
||||
public static RegexProperty iso8601WithOffset() {
|
||||
return new RegexProperty(ISO8601_WITH_OFFSET).asString();
|
||||
}
|
||||
|
||||
public static RegexProperty nonEmpty() {
|
||||
return new RegexProperty(NON_EMPTY).asString();
|
||||
}
|
||||
|
||||
public static RegexProperty nonBlank() {
|
||||
return new RegexProperty(NON_BLANK).asString();
|
||||
}
|
||||
|
||||
// end::regexps[]
|
||||
|
||||
public RegexProperty iso8601WithOffset() {
|
||||
return new RegexProperty(ISO8601_WITH_OFFSET).asString();
|
||||
}
|
||||
|
||||
public RegexProperty nonEmpty() {
|
||||
return new RegexProperty(NON_EMPTY).asString();
|
||||
}
|
||||
|
||||
public RegexProperty nonBlank() {
|
||||
return new RegexProperty(NON_BLANK).asString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ public class Request extends Common implements RegexCreatingProperty<ClientDslPr
|
||||
|
||||
private ClientPatternValueDslProperty property = new ClientPatternValueDslProperty();
|
||||
|
||||
private HttpMethods httpMethods = new HttpMethods();
|
||||
|
||||
private DslProperty method;
|
||||
|
||||
private Url url;
|
||||
@@ -390,14 +388,6 @@ public class Request extends Common implements RegexCreatingProperty<ClientDslPr
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
public HttpMethods getHttpMethods() {
|
||||
return httpMethods;
|
||||
}
|
||||
|
||||
public void setHttpMethods(HttpMethods httpMethods) {
|
||||
this.httpMethods = httpMethods;
|
||||
}
|
||||
|
||||
public DslProperty getMethod() {
|
||||
return method;
|
||||
}
|
||||
@@ -560,35 +550,35 @@ public class Request extends Common implements RegexCreatingProperty<ClientDslPr
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod GET() {
|
||||
return httpMethods.GET();
|
||||
return HttpMethods.GET();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod HEAD() {
|
||||
return httpMethods.HEAD();
|
||||
return HttpMethods.HEAD();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod POST() {
|
||||
return httpMethods.POST();
|
||||
return HttpMethods.POST();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod PUT() {
|
||||
return httpMethods.PUT();
|
||||
return HttpMethods.PUT();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod PATCH() {
|
||||
return httpMethods.PATCH();
|
||||
return HttpMethods.PATCH();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod DELETE() {
|
||||
return httpMethods.DELETE();
|
||||
return HttpMethods.DELETE();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod OPTIONS() {
|
||||
return httpMethods.OPTIONS();
|
||||
return HttpMethods.OPTIONS();
|
||||
}
|
||||
|
||||
public HttpMethods.HttpMethod TRACE() {
|
||||
return httpMethods.TRACE();
|
||||
return HttpMethods.TRACE();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,8 +56,6 @@ public class Response extends Common implements RegexCreatingProperty<ServerDslP
|
||||
|
||||
private ServerPatternValueDslProperty property = new ServerPatternValueDslProperty();
|
||||
|
||||
private HttpStatus httpStatus = new HttpStatus();
|
||||
|
||||
public Response() {
|
||||
}
|
||||
|
||||
@@ -251,14 +249,6 @@ public class Response extends Common implements RegexCreatingProperty<ServerDslP
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
public HttpStatus getHttpStatus() {
|
||||
return httpStatus;
|
||||
}
|
||||
|
||||
public void setHttpStatus(HttpStatus httpStatus) {
|
||||
this.httpStatus = httpStatus;
|
||||
}
|
||||
|
||||
public DslProperty getStatus() {
|
||||
return status;
|
||||
}
|
||||
@@ -425,278 +415,278 @@ public class Response extends Common implements RegexCreatingProperty<ServerDslP
|
||||
}
|
||||
|
||||
public int CONTINUE() {
|
||||
return httpStatus.CONTINUE();
|
||||
return HttpStatus.CONTINUE();
|
||||
}
|
||||
|
||||
public int SWITCHING_PROTOCOLS() {
|
||||
return httpStatus.SWITCHING_PROTOCOLS();
|
||||
return HttpStatus.SWITCHING_PROTOCOLS();
|
||||
}
|
||||
|
||||
public int PROCESSING() {
|
||||
return httpStatus.PROCESSING();
|
||||
return HttpStatus.PROCESSING();
|
||||
}
|
||||
|
||||
public int CHECKPOINT() {
|
||||
return httpStatus.CHECKPOINT();
|
||||
return HttpStatus.CHECKPOINT();
|
||||
}
|
||||
|
||||
public int OK() {
|
||||
return httpStatus.OK();
|
||||
return HttpStatus.OK();
|
||||
}
|
||||
|
||||
public int CREATED() {
|
||||
return httpStatus.CREATED();
|
||||
return HttpStatus.CREATED();
|
||||
}
|
||||
|
||||
public int ACCEPTED() {
|
||||
return httpStatus.ACCEPTED();
|
||||
return HttpStatus.ACCEPTED();
|
||||
}
|
||||
|
||||
public int NON_AUTHORITATIVE_INFORMATION() {
|
||||
return httpStatus.NON_AUTHORITATIVE_INFORMATION();
|
||||
return HttpStatus.NON_AUTHORITATIVE_INFORMATION();
|
||||
}
|
||||
|
||||
public int NO_CONTENT() {
|
||||
return httpStatus.NO_CONTENT();
|
||||
return HttpStatus.NO_CONTENT();
|
||||
}
|
||||
|
||||
public int RESET_CONTENT() {
|
||||
return httpStatus.RESET_CONTENT();
|
||||
return HttpStatus.RESET_CONTENT();
|
||||
}
|
||||
|
||||
public int PARTIAL_CONTENT() {
|
||||
return httpStatus.PARTIAL_CONTENT();
|
||||
return HttpStatus.PARTIAL_CONTENT();
|
||||
}
|
||||
|
||||
public int MULTI_STATUS() {
|
||||
return httpStatus.MULTI_STATUS();
|
||||
return HttpStatus.MULTI_STATUS();
|
||||
}
|
||||
|
||||
public int ALREADY_REPORTED() {
|
||||
return httpStatus.ALREADY_REPORTED();
|
||||
return HttpStatus.ALREADY_REPORTED();
|
||||
}
|
||||
|
||||
public int IM_USED() {
|
||||
return httpStatus.IM_USED();
|
||||
return HttpStatus.IM_USED();
|
||||
}
|
||||
|
||||
public int MULTIPLE_CHOICES() {
|
||||
return httpStatus.MULTIPLE_CHOICES();
|
||||
return HttpStatus.MULTIPLE_CHOICES();
|
||||
}
|
||||
|
||||
public int MOVED_PERMANENTLY() {
|
||||
return httpStatus.MOVED_PERMANENTLY();
|
||||
return HttpStatus.MOVED_PERMANENTLY();
|
||||
}
|
||||
|
||||
public int FOUND() {
|
||||
return httpStatus.FOUND();
|
||||
return HttpStatus.FOUND();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int MOVED_TEMPORARILY() {
|
||||
return httpStatus.MOVED_TEMPORARILY();
|
||||
return HttpStatus.MOVED_TEMPORARILY();
|
||||
}
|
||||
|
||||
public int SEE_OTHER() {
|
||||
return httpStatus.SEE_OTHER();
|
||||
return HttpStatus.SEE_OTHER();
|
||||
}
|
||||
|
||||
public int NOT_MODIFIED() {
|
||||
return httpStatus.NOT_MODIFIED();
|
||||
return HttpStatus.NOT_MODIFIED();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int USE_PROXY() {
|
||||
return httpStatus.USE_PROXY();
|
||||
return HttpStatus.USE_PROXY();
|
||||
}
|
||||
|
||||
public int TEMPORARY_REDIRECT() {
|
||||
return httpStatus.TEMPORARY_REDIRECT();
|
||||
return HttpStatus.TEMPORARY_REDIRECT();
|
||||
}
|
||||
|
||||
public int PERMANENT_REDIRECT() {
|
||||
return httpStatus.PERMANENT_REDIRECT();
|
||||
return HttpStatus.PERMANENT_REDIRECT();
|
||||
}
|
||||
|
||||
public int BAD_REQUEST() {
|
||||
return httpStatus.BAD_REQUEST();
|
||||
return HttpStatus.BAD_REQUEST();
|
||||
}
|
||||
|
||||
public int UNAUTHORIZED() {
|
||||
return httpStatus.UNAUTHORIZED();
|
||||
return HttpStatus.UNAUTHORIZED();
|
||||
}
|
||||
|
||||
public int PAYMENT_REQUIRED() {
|
||||
return httpStatus.PAYMENT_REQUIRED();
|
||||
return HttpStatus.PAYMENT_REQUIRED();
|
||||
}
|
||||
|
||||
public int FORBIDDEN() {
|
||||
return httpStatus.FORBIDDEN();
|
||||
return HttpStatus.FORBIDDEN();
|
||||
}
|
||||
|
||||
public int NOT_FOUND() {
|
||||
return httpStatus.NOT_FOUND();
|
||||
return HttpStatus.NOT_FOUND();
|
||||
}
|
||||
|
||||
public int METHOD_NOT_ALLOWED() {
|
||||
return httpStatus.METHOD_NOT_ALLOWED();
|
||||
return HttpStatus.METHOD_NOT_ALLOWED();
|
||||
}
|
||||
|
||||
public int NOT_ACCEPTABLE() {
|
||||
return httpStatus.NOT_ACCEPTABLE();
|
||||
return HttpStatus.NOT_ACCEPTABLE();
|
||||
}
|
||||
|
||||
public int PROXY_AUTHENTICATION_REQUIRED() {
|
||||
return httpStatus.PROXY_AUTHENTICATION_REQUIRED();
|
||||
return HttpStatus.PROXY_AUTHENTICATION_REQUIRED();
|
||||
}
|
||||
|
||||
public int REQUEST_TIMEOUT() {
|
||||
return httpStatus.REQUEST_TIMEOUT();
|
||||
return HttpStatus.REQUEST_TIMEOUT();
|
||||
}
|
||||
|
||||
public int CONFLICT() {
|
||||
return httpStatus.CONFLICT();
|
||||
return HttpStatus.CONFLICT();
|
||||
}
|
||||
|
||||
public int GONE() {
|
||||
return httpStatus.GONE();
|
||||
return HttpStatus.GONE();
|
||||
}
|
||||
|
||||
public int LENGTH_REQUIRED() {
|
||||
return httpStatus.LENGTH_REQUIRED();
|
||||
return HttpStatus.LENGTH_REQUIRED();
|
||||
}
|
||||
|
||||
public int PRECONDITION_FAILED() {
|
||||
return httpStatus.PRECONDITION_FAILED();
|
||||
return HttpStatus.PRECONDITION_FAILED();
|
||||
}
|
||||
|
||||
public int PAYLOAD_TOO_LARGE() {
|
||||
return httpStatus.PAYLOAD_TOO_LARGE();
|
||||
return HttpStatus.PAYLOAD_TOO_LARGE();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int REQUEST_ENTITY_TOO_LARGE() {
|
||||
return httpStatus.REQUEST_ENTITY_TOO_LARGE();
|
||||
return HttpStatus.REQUEST_ENTITY_TOO_LARGE();
|
||||
}
|
||||
|
||||
public int URI_TOO_LONG() {
|
||||
return httpStatus.URI_TOO_LONG();
|
||||
return HttpStatus.URI_TOO_LONG();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int REQUEST_URI_TOO_LONG() {
|
||||
return httpStatus.REQUEST_URI_TOO_LONG();
|
||||
return HttpStatus.REQUEST_URI_TOO_LONG();
|
||||
}
|
||||
|
||||
public int UNSUPPORTED_MEDIA_TYPE() {
|
||||
return httpStatus.UNSUPPORTED_MEDIA_TYPE();
|
||||
return HttpStatus.UNSUPPORTED_MEDIA_TYPE();
|
||||
}
|
||||
|
||||
public int REQUESTED_RANGE_NOT_SATISFIABLE() {
|
||||
return httpStatus.REQUESTED_RANGE_NOT_SATISFIABLE();
|
||||
return HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE();
|
||||
}
|
||||
|
||||
public int EXPECTATION_FAILED() {
|
||||
return httpStatus.EXPECTATION_FAILED();
|
||||
return HttpStatus.EXPECTATION_FAILED();
|
||||
}
|
||||
|
||||
public int I_AM_A_TEAPOT() {
|
||||
return httpStatus.I_AM_A_TEAPOT();
|
||||
return HttpStatus.I_AM_A_TEAPOT();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int INSUFFICIENT_SPACE_ON_RESOURCE() {
|
||||
return httpStatus.INSUFFICIENT_SPACE_ON_RESOURCE();
|
||||
return HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int METHOD_FAILURE() {
|
||||
return httpStatus.METHOD_FAILURE();
|
||||
return HttpStatus.METHOD_FAILURE();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public int DESTINATION_LOCKED() {
|
||||
return httpStatus.DESTINATION_LOCKED();
|
||||
return HttpStatus.DESTINATION_LOCKED();
|
||||
}
|
||||
|
||||
public int UNPROCESSABLE_ENTITY() {
|
||||
return httpStatus.UNPROCESSABLE_ENTITY();
|
||||
return HttpStatus.UNPROCESSABLE_ENTITY();
|
||||
}
|
||||
|
||||
public int LOCKED() {
|
||||
return httpStatus.LOCKED();
|
||||
return HttpStatus.LOCKED();
|
||||
}
|
||||
|
||||
public int FAILED_DEPENDENCY() {
|
||||
return httpStatus.FAILED_DEPENDENCY();
|
||||
return HttpStatus.FAILED_DEPENDENCY();
|
||||
}
|
||||
|
||||
public int UPGRADE_REQUIRED() {
|
||||
return httpStatus.UPGRADE_REQUIRED();
|
||||
return HttpStatus.UPGRADE_REQUIRED();
|
||||
}
|
||||
|
||||
public int PRECONDITION_REQUIRED() {
|
||||
return httpStatus.PRECONDITION_REQUIRED();
|
||||
return HttpStatus.PRECONDITION_REQUIRED();
|
||||
}
|
||||
|
||||
public int TOO_MANY_REQUESTS() {
|
||||
return httpStatus.TOO_MANY_REQUESTS();
|
||||
return HttpStatus.TOO_MANY_REQUESTS();
|
||||
}
|
||||
|
||||
public int REQUEST_HEADER_FIELDS_TOO_LARGE() {
|
||||
return httpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE();
|
||||
return HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE();
|
||||
}
|
||||
|
||||
public int UNAVAILABLE_FOR_LEGAL_REASONS() {
|
||||
return httpStatus.UNAVAILABLE_FOR_LEGAL_REASONS();
|
||||
return HttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS();
|
||||
}
|
||||
|
||||
public int INTERNAL_SERVER_ERROR() {
|
||||
return httpStatus.INTERNAL_SERVER_ERROR();
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR();
|
||||
}
|
||||
|
||||
public int NOT_IMPLEMENTED() {
|
||||
return httpStatus.NOT_IMPLEMENTED();
|
||||
return HttpStatus.NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
public int BAD_GATEWAY() {
|
||||
return httpStatus.BAD_GATEWAY();
|
||||
return HttpStatus.BAD_GATEWAY();
|
||||
}
|
||||
|
||||
public int SERVICE_UNAVAILABLE() {
|
||||
return httpStatus.SERVICE_UNAVAILABLE();
|
||||
return HttpStatus.SERVICE_UNAVAILABLE();
|
||||
}
|
||||
|
||||
public int GATEWAY_TIMEOUT() {
|
||||
return httpStatus.GATEWAY_TIMEOUT();
|
||||
return HttpStatus.GATEWAY_TIMEOUT();
|
||||
}
|
||||
|
||||
public int HTTP_VERSION_NOT_SUPPORTED() {
|
||||
return httpStatus.HTTP_VERSION_NOT_SUPPORTED();
|
||||
return HttpStatus.HTTP_VERSION_NOT_SUPPORTED();
|
||||
}
|
||||
|
||||
public int VARIANT_ALSO_NEGOTIATES() {
|
||||
return httpStatus.VARIANT_ALSO_NEGOTIATES();
|
||||
return HttpStatus.VARIANT_ALSO_NEGOTIATES();
|
||||
}
|
||||
|
||||
public int INSUFFICIENT_STORAGE() {
|
||||
return httpStatus.INSUFFICIENT_STORAGE();
|
||||
return HttpStatus.INSUFFICIENT_STORAGE();
|
||||
}
|
||||
|
||||
public int LOOP_DETECTED() {
|
||||
return httpStatus.LOOP_DETECTED();
|
||||
return HttpStatus.LOOP_DETECTED();
|
||||
}
|
||||
|
||||
public int BANDWIDTH_LIMIT_EXCEEDED() {
|
||||
return httpStatus.BANDWIDTH_LIMIT_EXCEEDED();
|
||||
return HttpStatus.BANDWIDTH_LIMIT_EXCEEDED();
|
||||
}
|
||||
|
||||
public int NOT_EXTENDED() {
|
||||
return httpStatus.NOT_EXTENDED();
|
||||
return HttpStatus.NOT_EXTENDED();
|
||||
}
|
||||
|
||||
public int NETWORK_AUTHENTICATION_REQUIRED() {
|
||||
return httpStatus.NETWORK_AUTHENTICATION_REQUIRED();
|
||||
return HttpStatus.NETWORK_AUTHENTICATION_REQUIRED();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user