Search in sources :

Example 91 with Override

use of java.lang.Override in project zeppelin by apache.

the class MockHDFSFileInterpreter method prepare.

@Override
public void prepare() {
    // Run commands against mock File System instead of WebHDFS
    cmd = new MockHDFSCommand("", "", logger);
    gson = new Gson();
}
Also used : Gson(com.google.gson.Gson) Override(java.lang.Override)

Example 92 with Override

use of java.lang.Override in project LoganSquare by bluelinelabs.

the class SimpleCollectionModel$$JsonObjectMapper method parse.

@Override
public SimpleCollectionModel parse(JsonParser jsonParser) throws IOException {
    SimpleCollectionModel instance = new SimpleCollectionModel();
    if (jsonParser.getCurrentToken() == null) {
        jsonParser.nextToken();
    }
    if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
        jsonParser.skipChildren();
        return null;
    }
    while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
        String fieldName = jsonParser.getCurrentName();
        jsonParser.nextToken();
        parseField(instance, fieldName, jsonParser);
        jsonParser.skipChildren();
    }
    return instance;
}
Also used : String(java.lang.String) Override(java.lang.Override)

Example 93 with Override

use of java.lang.Override in project LoganSquare by bluelinelabs.

the class SimpleGenericModel$$JsonObjectMapper method parse.

@Override
public SimpleGenericModel<T> parse(JsonParser jsonParser) throws IOException {
    SimpleGenericModel<T> instance = new SimpleGenericModel<T>();
    if (jsonParser.getCurrentToken() == null) {
        jsonParser.nextToken();
    }
    if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
        jsonParser.skipChildren();
        return null;
    }
    while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
        String fieldName = jsonParser.getCurrentName();
        jsonParser.nextToken();
        parseField(instance, fieldName, jsonParser);
        jsonParser.skipChildren();
    }
    return instance;
}
Also used : String(java.lang.String) Override(java.lang.Override)

Example 94 with Override

use of java.lang.Override in project LoganSquare by bluelinelabs.

the class SimpleModel$$JsonObjectMapper method parseField.

@Override
public void parseField(SimpleModel instance, String fieldName, JsonParser jsonParser) throws IOException {
    if ("date".equals(fieldName)) {
        instance.date = getjava_util_Date_type_converter().parse(jsonParser);
    } else if ("intToIgnoreForSerialization".equals(fieldName)) {
        instance.intToIgnoreForSerialization = jsonParser.getValueAsInt();
    } else if ("object-array-with-dashes".equals(fieldName)) {
        if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
            List<Object> collection1 = new ArrayList<Object>();
            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                Object value1;
                value1 = COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.parse(jsonParser);
                collection1.add(value1);
            }
            Object[] array = collection1.toArray(new Object[collection1.size()]);
            instance.objectArrayWithDashes = array;
        } else {
            instance.objectArrayWithDashes = null;
        }
    } else if ("object-list-with-dashes".equals(fieldName)) {
        if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
            ArrayList<Object> collection1 = new ArrayList<Object>();
            while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                Object value1;
                value1 = COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.parse(jsonParser);
                collection1.add(value1);
            }
            instance.objectListWithDashes = collection1;
        } else {
            instance.objectListWithDashes = null;
        }
    } else if ("object_map".equals(fieldName)) {
        if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
            HashMap<String, Object> map1 = new HashMap<String, Object>();
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String key1 = jsonParser.getText();
                jsonParser.nextToken();
                if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
                    map1.put(key1, null);
                } else {
                    map1.put(key1, COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.parse(jsonParser));
                }
            }
            instance.objectMap = map1;
        } else {
            instance.objectMap = null;
        }
    } else if ("object-map-with-dashes".equals(fieldName)) {
        if (jsonParser.getCurrentToken() == JsonToken.START_OBJECT) {
            HashMap<String, Object> map1 = new HashMap<String, Object>();
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String key1 = jsonParser.getText();
                jsonParser.nextToken();
                if (jsonParser.getCurrentToken() == JsonToken.VALUE_NULL) {
                    map1.put(key1, null);
                } else {
                    map1.put(key1, COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.parse(jsonParser));
                }
            }
            instance.objectMapWithDashes = map1;
        } else {
            instance.objectMapWithDashes = null;
        }
    } else if ("string".equals(fieldName)) {
        instance.string = jsonParser.getValueAsString(null);
    } else if ("test_double".equals(fieldName)) {
        instance.testDouble = jsonParser.getValueAsDouble();
    } else if ("test_double_obj".equals(fieldName)) {
        instance.testDoubleObj = jsonParser.getCurrentToken() == JsonToken.VALUE_NULL ? null : Double.valueOf(jsonParser.getValueAsDouble());
    } else if ("test_float".equals(fieldName)) {
        instance.testFloat = (float) jsonParser.getValueAsDouble();
    } else if ("test_float_obj".equals(fieldName)) {
        instance.testFloatObj = jsonParser.getCurrentToken() == JsonToken.VALUE_NULL ? null : new Float(jsonParser.getValueAsDouble());
    } else if ("test_int".equals(fieldName)) {
        instance.testInt = jsonParser.getValueAsInt();
    } else if ("test_int_obj".equals(fieldName)) {
        instance.testIntObj = jsonParser.getCurrentToken() == JsonToken.VALUE_NULL ? null : Integer.valueOf(jsonParser.getValueAsInt());
    } else if ("test_long".equals(fieldName)) {
        instance.testLong = jsonParser.getValueAsLong();
    } else if ("test_long_obj".equals(fieldName)) {
        instance.testLongObj = jsonParser.getCurrentToken() == JsonToken.VALUE_NULL ? null : Long.valueOf(jsonParser.getValueAsLong());
    } else if ("test_string".equals(fieldName)) {
        instance.testString = jsonParser.getValueAsString(null);
    }
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Object(java.lang.Object) String(java.lang.String) Override(java.lang.Override)

Example 95 with Override

use of java.lang.Override in project LoganSquare by bluelinelabs.

the class SimpleModel$$JsonObjectMapper method serialize.

@Override
public void serialize(SimpleModel object, JsonGenerator jsonGenerator, boolean writeStartAndEnd) throws IOException {
    if (writeStartAndEnd) {
        jsonGenerator.writeStartObject();
    }
    if (object.date != null) {
        getjava_util_Date_type_converter().serialize(object.date, "date", true, jsonGenerator);
    }
    jsonGenerator.writeNumberField("intToIgnoreForParse", object.intToIgnoreForParse);
    final Object[] lslocalobject_array_with_dashes = object.objectArrayWithDashes;
    if (lslocalobject_array_with_dashes != null) {
        jsonGenerator.writeFieldName("object-array-with-dashes");
        jsonGenerator.writeStartArray();
        for (Object element1 : lslocalobject_array_with_dashes) {
            if (element1 != null) {
                COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.serialize(element1, jsonGenerator, false);
            }
        }
        jsonGenerator.writeEndArray();
    }
    final List<Object> lslocalobject_list_with_dashes = object.objectListWithDashes;
    if (lslocalobject_list_with_dashes != null) {
        jsonGenerator.writeFieldName("object-list-with-dashes");
        jsonGenerator.writeStartArray();
        for (Object element1 : lslocalobject_list_with_dashes) {
            if (element1 != null) {
                COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.serialize(element1, jsonGenerator, false);
            }
        }
        jsonGenerator.writeEndArray();
    }
    final Map<String, Object> lslocalobject_map = object.objectMap;
    if (lslocalobject_map != null) {
        jsonGenerator.writeFieldName("object_map");
        jsonGenerator.writeStartObject();
        for (Map.Entry<String, Object> entry1 : lslocalobject_map.entrySet()) {
            jsonGenerator.writeFieldName(entry1.getKey().toString());
            if (entry1.getValue() != null) {
                COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.serialize(entry1.getValue(), jsonGenerator, false);
            }
        }
        jsonGenerator.writeEndObject();
    }
    final Map<String, Object> lslocalobject_map_with_dashes = object.objectMapWithDashes;
    if (lslocalobject_map_with_dashes != null) {
        jsonGenerator.writeFieldName("object-map-with-dashes");
        jsonGenerator.writeStartObject();
        for (Map.Entry<String, Object> entry1 : lslocalobject_map_with_dashes.entrySet()) {
            jsonGenerator.writeFieldName(entry1.getKey().toString());
            if (entry1.getValue() != null) {
                COM_BLUELINELABS_LOGANSQUARE_INTERNAL_OBJECTMAPPERS_OBJECTMAPPER.serialize(entry1.getValue(), jsonGenerator, false);
            }
        }
        jsonGenerator.writeEndObject();
    }
    if (object.string != null) {
        jsonGenerator.writeStringField("string", object.string);
    }
    jsonGenerator.writeNumberField("test_double", object.testDouble);
    if (object.testDoubleObj != null) {
        jsonGenerator.writeNumberField("test_double_obj", object.testDoubleObj);
    }
    jsonGenerator.writeNumberField("test_float", object.testFloat);
    if (object.testFloatObj != null) {
        jsonGenerator.writeNumberField("test_float_obj", object.testFloatObj);
    }
    jsonGenerator.writeNumberField("test_int", object.testInt);
    if (object.testIntObj != null) {
        jsonGenerator.writeNumberField("test_int_obj", object.testIntObj);
    }
    jsonGenerator.writeNumberField("test_long", object.testLong);
    if (object.testLongObj != null) {
        jsonGenerator.writeNumberField("test_long_obj", object.testLongObj);
    }
    if (object.testString != null) {
        jsonGenerator.writeStringField("test_string", object.testString);
    }
    if (writeStartAndEnd) {
        jsonGenerator.writeEndObject();
    }
}
Also used : Object(java.lang.Object) String(java.lang.String) HashMap(java.util.HashMap) Map(java.util.Map) Override(java.lang.Override)

Aggregations

Override (java.lang.Override)177 StringBuilder (java.lang.StringBuilder)83 String (java.lang.String)36 NonNull (android.support.annotation.NonNull)24 ContentValues (android.content.ContentValues)12 ArrayList (java.util.ArrayList)11 View (android.view.View)10 Integer (java.lang.Integer)9 Long (java.lang.Long)9 HashMap (java.util.HashMap)9 Boolean (java.lang.Boolean)8 Double (java.lang.Double)8 Float (java.lang.Float)8 Short (java.lang.Short)8 Bitmap (android.graphics.Bitmap)5 Canvas (android.graphics.Canvas)5 Handler (android.os.Handler)5 HandlerThread (android.os.HandlerThread)5 SmallTest (android.test.suitebuilder.annotation.SmallTest)5 Map (java.util.Map)5