Skip to content

Commit

Permalink
3.2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
noear committed Feb 24, 2022
1 parent 5ff1388 commit ed876d0
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<dependency>
<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Based on JDK8, 80Kb. Support: serialization and deserialization, parsing and tra
<dependency>
<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
</dependency>
```

Expand Down
3 changes: 3 additions & 0 deletions UPDATE_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 3.2.16
* 枚举支持字符大小写

#### 3.2.14
* 增加字符串 "true" 转为 Boolean

Expand Down
2 changes: 1 addition & 1 deletion snack3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
<packaging>jar</packaging>

<name>${project.artifactId}</name>
Expand Down
13 changes: 6 additions & 7 deletions snack3/src/main/java/org/noear/snack/core/exts/EnumWrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@
* */
public class EnumWrap {
protected final Map<String, Enum> enumMap = new HashMap<>();
protected final Enum[] enumOrdinal;
protected final Enum[] enumOrdinal;

public EnumWrap(Class<?> enumClass){
public EnumWrap(Class<?> enumClass) {
enumOrdinal = (Enum[]) enumClass.getEnumConstants();

for (int i = 0; i < enumOrdinal.length; ++i) {
Enum e = enumOrdinal[i];
String name = e.name();

enumMap.put(name,e);
enumMap.put(e.name().toLowerCase(), e);
}
}

public Enum get(int ordinal){
public Enum get(int ordinal) {
return enumOrdinal[ordinal];
}

public Enum get(String name){
return enumMap.get(name);
public Enum get(String name) {
return enumMap.get(name.toLowerCase());
}
}
2 changes: 1 addition & 1 deletion snack3_demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
</dependency>

<!-- <dependency>-->
Expand Down
2 changes: 1 addition & 1 deletion 文章_Java_中_Snack3的使用.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Snack3 基于jdk8,60kb大小,非常小巧。
<dependency>
<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion 文章_Snack3_一个新的微型JSON框架.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ONode 即 `One node` 之意;借签了 `Javascript` 所有变量由 `var` 申
<dependency>
<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion 文章_Snack3之Jsonpath使用.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Snack3 是一个支持JSONPath的JSON框架。JSONPath是一个很强大的功
<dependency>
<groupId>org.noear</groupId>
<artifactId>snack3</artifactId>
<version>3.2.15</version>
<version>3.2.16</version>
</dependency>
```

Expand Down

0 comments on commit ed876d0

Please sign in to comment.