Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactored method name validate() to createValidType().

  • Loading branch information...
commit 669001f0fa6b1f600778da62c14e36a412761bd1 1 parent 5a07888
bbansal bbansal authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/java/voldemort/serialization/json/JsonTypeDefinition.java
10 src/java/voldemort/serialization/json/JsonTypeDefinition.java
View
@@ -50,7 +50,7 @@
private Object type;
public JsonTypeDefinition(Object type) {
- this.type = validate(type);
+ this.type = createValidType(type);
}
@@ -162,17 +162,17 @@ public static String format(Object type) {
}
public void validate() {
- validate(getType());
+ createValidType(getType());
}
- private Object validate(Object type) {
+ private Object createValidType(Object type) {
if(type == null) {
throw new IllegalArgumentException("Type or subtype cannot be null.");
} else if(type instanceof List<?>) {
List<?> l = (List<?>) type;
if(l.size() != 1)
throw new IllegalArgumentException("Lists in type definition must have length exactly one.");
- return Arrays.asList(validate(l.get(0)));
+ return Arrays.asList(createValidType(l.get(0)));
} else if(type instanceof Map<?, ?>) {
Map<String, ?> m = (Map<String, ?>) type;
// bbansal: sort keys here for consistent with fromJson()
@@ -180,7 +180,7 @@ private Object validate(Object type) {
List<String> keys = new ArrayList<String>((m.keySet()));
Collections.sort(keys);
for(String key: keys)
- newM.put(key, validate(m.get(key)));
+ newM.put(key, createValidType(m.get(key)));
return newM;
} else if(type instanceof JsonTypes) {
// this is good
Please sign in to comment.
Something went wrong with that request. Please try again.