package ch.difty.scipamato.common.entity;

import java.util.Arrays;
import java.util.Optional;

/**
 * Code Classes are collections of code that can be maintained separately for a
 * paper. In order to profit from i18n, there is a separate set of tables with
 * one entry per member here.
 *
 * @author u.joss
 */
public enum CodeClassId {

    CC1(1),
    CC2(2),
    CC3(3),
    CC4(4),
    CC5(5),
    CC6(6),
    CC7(7),
    CC8(8);

    // cache values
    private static final CodeClassId[] codeClassId = values();

    private final int id;

    CodeClassId(final int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public static Optional<CodeClassId> fromId(final int id) {
        return Arrays.asList(codeClassId)
            .stream()
            .filter(i -> i.getId() == id)
            .findFirst();
    }

}

@@ -490,27 +490,30 @@
 assId%5B%5D 
-codeClassId
+CODE_CLASS_IDS
  = value
@@ -753,19 +753,22 @@
 ist(
-codeClassId
+CODE_CLASS_IDS
 )%0A  

fix clodeclassid