Z3
Z3_parameter_kind.java
Go to the documentation of this file.
1 
5 package com.microsoft.z3.enumerations;
6 
7 import java.util.HashMap;
8 import java.util.Map;
9 
13 public enum Z3_parameter_kind {
21 
22  private final int intValue;
23 
25  this.intValue = v;
26  }
27 
28  // Cannot initialize map in constructor, so need to do it lazily.
29  // Easiest thread-safe way is the initialization-on-demand holder pattern.
30  private static class Z3_parameter_kind_MappingHolder {
31  private static final Map<Integer, Z3_parameter_kind> intMapping = new HashMap<>();
32  static {
33  for (Z3_parameter_kind k : Z3_parameter_kind.values())
34  intMapping.put(k.toInt(), k);
35  }
36  }
37 
38  public static final Z3_parameter_kind fromInt(int v) {
39  Z3_parameter_kind k = Z3_parameter_kind_MappingHolder.intMapping.get(v);
40  if (k != null) return k;
41  throw new IllegalArgumentException("Illegal value " + v + " for Z3_parameter_kind");
42  }
43 
44  public final int toInt() { return this.intValue; }
45 }
46 
static final Z3_parameter_kind fromInt(int v)