title: spring thymeleaf Sort enum alphbetically
body: <p>I have an enum:</p>
  
  <pre><code>public static enum States {
  
      SEL("Selangor"),
      WP("Wilayah Persekutuan"),      
      KEL("Kelantan"),
      LAB("Labuan"),
      PER("Perlis");  
  
      private String value;
  
      States(String val) {
          this.value = val ;
      }
  
      public String getValue() {
          return value;
      }       
  }
  </code></pre>
  
  <p>The values are displayed on a Thymeleaf template by:</p>
  
  <pre><code>&lt;div class="col-xs-6 padding-sides-none"&gt;
    &lt;div class="form-group col-xs-12 padding-sides-none"&gt;
      &lt;label class="col-xs-2 padding-sides-none" style="margin-left:15px"&gt;State&lt;/label&gt;
      &lt;div class="col-xs-7 padding-sides-none"&gt;
        &lt;select class="form-control selectpicker" data-live-search="true"
                style="width:300px;margin-left: 50px;"&gt;
          &lt;option value="" selected disabled hidden&gt;Please select a state&lt;/option&gt;
          &lt;option th:each="state : ${T(com.workspez.model.Accountant.States).values()}"
                  th:value="${state}" th:text="${state.getValue()}"&gt;
          &lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to display the values in alphabetical order. is it possible? One way is to manually arrange the enum but is there any way to sort the enum list?
  Thanks.</p>