首页 > 代码库 > 关于static静态块的使用和static list的使用

关于static静态块的使用和static list的使用

public class CorsConfiguration {

/**
* Wildcard representing <em>all</em> origins, methods, or headers.
*/
public static final String ALL = "*";

private static final List<HttpMethod> DEFAULT_METHODS;

static {
List<HttpMethod> rawMethods = new ArrayList<HttpMethod>(2);
rawMethods.add(HttpMethod.GET);
rawMethods.add(HttpMethod.HEAD);
DEFAULT_METHODS = Collections.unmodifiableList(rawMethods);
}

关于static静态块的使用和static list的使用