// Path: app/src/main/java/com/github/wakhub/monodict/MonodictApp.java
// @EApplication
// public class MonodictApp extends Application {
// 
//     private static final String TAG = MonodictApp.class.getSimpleName();
// 
//     private static final EventBus eventBus = new EventBus();
// 
//     public static final EventBus getEventBus() {
//         return eventBus;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// //        setLocale(Locale.JAPANESE);
//     }
// 
//     public static final PackageInfo getPackageInfo(Context context) {
//         String packageName = context.getPackageName();
//         try {
//             return context.getPackageManager().getPackageInfo(packageName, 0);
//         } catch (PackageManager.NameNotFoundException e) {
//             return null;
//         }
//     }
// 
//     private void setLocale(Locale locale) {
//         Resources resources = getResources();
//         Configuration conf = resources.getConfiguration();
//         conf.locale = locale;
//         resources.updateConfiguration(conf, resources.getDisplayMetrics());
//     }
// }


import android.database.Cursor;
import com.github.wakhub.monodict.MonodictApp;
import com.google.gson.JsonObject;
import com.j256.ormlite.field.DatabaseField;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
 * Copyright (C) 2014 wak
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.wakhub.monodict.db;




/**
 * Created by wak on 5/17/14.
 */
public abstract class Model {

    private static final String TAG = Model.class.getSimpleName();

    public static class Column {
        public static final String ID = "_id";
        public static final String CREATED_AT = "createdAt";
        public static final String UPDATED_AT = "updatedAt";
    }

    static String getStringFromJson(JsonObject jsonObject, String key) {
        if (jsonObject.get(key) == null) {
            return "";
        }
        String itemString = jsonObject.get(key).getAsString();
        if (itemString == null) {
            return "";
        }
        return itemString;
    }

// Path: app/src/main/java/com/github/wakhub/monodict/MonodictApp.java
// @EApplication
// public class MonodictApp extends Application {
// 
//     private static final String TAG = MonodictApp.class.getSimpleName();
// 
//     private static final EventBus eventBus = new EventBus();
// 
//     public static final EventBus getEventBus() {
//         return eventBus;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
// //        setLocale(Locale.JAPANESE);
//     }
// 
//     public static final PackageInfo getPackageInfo(Context context) {
//         String packageName = context.getPackageName();
//         try {
//             return context.getPackageManager().getPackageInfo(packageName, 0);
//         } catch (PackageManager.NameNotFoundException e) {
//             return null;
//         }
//     }
// 
//     private void setLocale(Locale locale) {
//         Resources resources = getResources();
//         Configuration conf = resources.getConfiguration();
//         conf.locale = locale;
//         resources.updateConfiguration(conf, resources.getDisplayMetrics());
//     }
// }


// Path: app/src/main/java/com/github/wakhub/monodict/db/Model.java
import android.database.Cursor;
import com.github.wakhub.monodict.MonodictApp;
import com.google.gson.JsonObject;
import com.j256.ormlite.field.DatabaseField;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * Copyright (C) 2014 wak
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.wakhub.monodict.db;




/**
 * Created by wak on 5/17/14.
 */
public abstract class Model {

    private static final String TAG = Model.class.getSimpleName();

    public static class Column {
        public static final String ID = "_id";
        public static final String CREATED_AT = "createdAt";
        public static final String UPDATED_AT = "updatedAt";
    }

    static String getStringFromJson(JsonObject jsonObject, String key) {
        if (jsonObject.get(key) == null) {
            return "";
        }
        String itemString = jsonObject.get(key).getAsString();
        if (itemString == null) {
            return "";
        }
        return itemString;
    }

    static String getStringFromCursor(Cursor cursor, String columnName) {