[ Web Proxy ]
URL:
Viewing:
https://raw.githubusercontent.com/APIJSON/APIJSON/main/src/main/java/apijson/RequestMethod.java
[Back]
[Original]
/*Copyright (C) 2026 the APIJSON group. All rights reserved. This source code is licensed under the Apache License Version 2.0.*/ package apijson; import java.util.Arrays; import java.util.List; /**org.springframework.web.bind.annotation.RequestMethodGETS,HEADS * @author Lemon */ public enum RequestMethod { /** * */ GET, /** * */ HEAD, /**Safe, Single, Simple *
GETPOSTGET */ GETS, /**Safe, Single, Simple *
HEADPOSTHEAD */ HEADS, /** * () */ POST, /** * */ PUT, /** * */ DELETE, /** * json */ CRUD; public static final RequestMethod[] ALL = new RequestMethod[]{ GET, HEAD, GETS, HEADS, POST, PUT, DELETE, CRUD }; public static final List ALL_NAME_LIST = Arrays.asList( GET.name(), HEAD.name(), GETS.name(), HEADS.name(), POST.name(), PUT.name(), DELETE.name(), CRUD.name() ); /**GET * @param method * @param containPrivate ()GETS * @return */ public static boolean isGetMethod(RequestMethod method, boolean containPrivate) { return method == null || method == GET || (containPrivate && method == GETS); } /**HEAD * @param method * @param containPrivate ()HEADS * @return */ public static boolean isHeadMethod(RequestMethod method, boolean containPrivate) { return method == HEAD || (containPrivate && method == HEADS); } /** * @param method * @return (GETHEAD) - true, (POST,PUT,DELETE) - false */ public static boolean isQueryMethod(RequestMethod method) { return isGetMethod(method, true) || isHeadMethod(method, true); } /**() * @param method * @return (GETHEAD) - false, (POST,PUT,DELETE) - true */ public static boolean isUpdateMethod(RequestMethod method) { return ! isQueryMethod(method); } /**() * @param method * @return */ public static boolean isPublicMethod(RequestMethod method) { return method == null || method == GET || method == HEAD; } /**() * @param method * @return */ public static boolean isPrivateMethod(RequestMethod method) { return ! isPublicMethod(method); } public static String getName(RequestMethod method) { return method == null ? GET.name() : method.name(); } }
Web Proxy Viewer |
New URL
|
Original Page