f7
f7 is a spreadsheet formula execution library
git clone https://git.vogt.world/f7.git
Log | Files | README.md | LICENSE.md
← All files
name: src/main/java/io/protobase/f7/errors/F7ExceptionName.java
-rw-r--r--
745
 1package io.protobase.f7.errors;
 2
 3public enum F7ExceptionName {
 4  NULL("#NULL!", 1),
 5  DIV("#DIV/0!", 2),
 6  VALUE("#VALUE!", 3),
 7  REF("#REF!", 4),
 8  NAME("#NAME?", 5),
 9  NUM("#NUM!", 6),
10  NA("#N/A", 7),
11  PARSE("#ERROR!", 8);
12
13  private String name;
14  private int code;
15
16  F7ExceptionName(String name, int code) {
17    this.name = name;
18    this.code = code;
19  }
20
21  public static F7ExceptionName fromString(String string) {
22    for (F7ExceptionName name : F7ExceptionName.values()) {
23      if (name.getName().equalsIgnoreCase(string))
24        return name;
25    }
26    return null;
27  }
28
29  public String getName() {
30    return name;
31  }
32
33  public int getCode() {
34    return code;
35  }
36
37  @Override
38  public String toString() {
39    return name;
40  }
41}