View Javadoc
1   /*
2    * Copyright (C) 2026 B3Partners B.V.
3    *
4    * SPDX-License-Identifier: MIT
5    */
6   package org.tailormap.api.persistence;
7   
8   import jakarta.persistence.EnumeratedValue;
9   import java.util.List;
10  
11  public enum UploadCategory {
12    LEGEND("legend"),
13    LAYER_ATTACHED_FILE("layer-attached-file"),
14    APP_LOGO("app-logo"),
15    HEADER_LOGO("header-logo"),
16    PORTAL_IMAGE("portal-image"),
17    DRAWING_STYLE("drawing-style"),
18    DRAWING_STYLE_IMAGE("drawing-style-image"),
19    SSO_IMAGE("sso-image"),
20    THEME_THEME_LOGO("theme-theme-logo"),
21    THEME_FAVICON("theme-favicon"),
22    UNRESTRICTED("unrestricted");
23  
24    @EnumeratedValue
25    private final String value;
26  
27    UploadCategory(String value) {
28      this.value = value;
29    }
30  
31    public String getValue() {
32      return value;
33    }
34  
35    /**
36     * Returns the string representation of the enum value.
37     *
38     * @return the string representation of the enum value
39     * @see #getValue()
40     */
41    @Override
42    public String toString() {
43      return getValue();
44    }
45  
46    public static List<UploadCategory> getUnrestrictedCategories() {
47      return List.of(
48          APP_LOGO,
49          PORTAL_IMAGE,
50          DRAWING_STYLE,
51          DRAWING_STYLE_IMAGE,
52          SSO_IMAGE,
53          THEME_THEME_LOGO,
54          THEME_FAVICON,
55          UNRESTRICTED);
56    }
57  
58    public static List<UploadCategory> getRestrictedCategories() {
59      return List.of(LAYER_ATTACHED_FILE, LEGEND);
60    }
61  }