hayio
11/17/2016 - 10:41 AM

Enum with constructor additional parameters.

Enum with constructor additional parameters.

	public enum VapField {
		TITLE("title"), 
		ADDITIONALINFORMATION("additionalInformation");

		private String header;

		private VapField(String header) {
			this.header = header;
		}

		public String getHeader() {
			return header;
		}
		
		public static Set<String> getHeaders() {
			final Set<String> res = new HashSet<>();
			for (VapField vap : VapField.values()) {
				res.add(vap.getHeader());
			}
			return res;
		}
	}