Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21a25b5
commit ba4d122
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
couchbase-driver/src/main/java/org/jnosql/diana/couchbase/key/JsonValueCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2017 Otávio Santana and others | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* and Apache License v2.0 which accompanies this distribution. | ||
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html | ||
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. | ||
* | ||
* You may elect to redistribute this code under either of these licenses. | ||
* | ||
* Contributors: | ||
* | ||
* Otavio Santana | ||
*/ | ||
package org.jnosql.diana.couchbase.key; | ||
|
||
import com.couchbase.client.java.document.json.JsonArray; | ||
import com.couchbase.client.java.document.json.JsonObject; | ||
|
||
import java.math.BigDecimal; | ||
import java.math.BigInteger; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
final class JsonValueCheck { | ||
|
||
private static final List<Class<?>> CLASSES; | ||
|
||
static { | ||
|
||
CLASSES = new ArrayList<>(); | ||
CLASSES.add(String.class); | ||
CLASSES.add(Integer.class); | ||
CLASSES.add(Long.class); | ||
CLASSES.add(Double.class); | ||
CLASSES.add(Boolean.class); | ||
CLASSES.add(BigInteger.class); | ||
CLASSES.add(BigDecimal.class); | ||
CLASSES.add(JsonObject.class); | ||
CLASSES.add(JsonArray.class); | ||
} | ||
|
||
private JsonValueCheck() { | ||
} | ||
|
||
public static boolean checkType(Class<?> type) { | ||
return CLASSES.contains(type); | ||
} | ||
} |