Converting to new firebase - enums
<p>Today I tried to move to the new (Google)Firebase.</p>

<p>Not only is the API different, but also the way data is stored in the database is different.
For instance, numbers (Double) saved in the database as "7.5" is not parsed correctly (identified as string) when it was originally written to the database this way by the old Firebase. Had to manually rewrite the database for Doubles ("7.5" to 7.5), Booleans ("true" to true) etc.</p>

<p>Now I come upon a new issue. I get an error when trying to write enums to the database:</p>

<blockquote>
  <p>FATAL EXCEPTION: main
                                                                                        Process: com.aayaffe.sailingracecoursemanager, PID: 21845
                                                                                        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aayaffe.sailingracecoursemanager/com.aayaffe.sailingracecoursemanager.map.GoogleMapsActivity}: com.google.firebase.database.DatabaseException: No properties to serialize found on class com.aayaffe.sailingracecoursemanager.communication.ObjectTypes
                                                                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
                                                                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723)
                                                                                            at android.app.ActivityThread.access$900(ActivityThread.java:172)
                                                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
                                                                                            at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                            at android.os.Looper.loop(Looper.java:145)
                                                                                            at android.app.ActivityThread.main(ActivityThread.java:5832)
                                                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                                                            at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
                                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
                                                                                         Caused by: com.google.firebase.database.DatabaseException: No properties to serialize found on class com.aayaffe.sailingracecoursemanager.communication.ObjectTypes
                                                                                            at com.google.android.gms.internal.zzaix$zza.(Unknown Source)
                                                                                            at com.google.android.gms.internal.zzaix.zzj(Unknown Source)
                                                                                            at com.google.android.gms.internal.zzaix.zzaw(Unknown Source)
                                                                                            at com.google.android.gms.internal.zzaix.zzaD(Unknown Source)
                                                                                            at com.google.android.gms.internal.zzaix$zza.zzaE(Unknown Source)
                                                                                            at com.google.android.gms.internal.zzaix.zzaw(Unknown Source)
                                                                                            at com.google.android.gms.internal.zzaix.zzav(Unknown Source)
                                                                                            at com.google.firebase.database.DatabaseReference.zza(Unknown Source)
                                                                                            at com.google.firebase.database.DatabaseReference.setValue(Unknown Source)
                                                                                            at com.aayaffe.sailingracecoursemanager.communication.Firebase.writeBoatObject(Firebase.java:135)
                                                                                            at com.aayaffe.sailingracecoursemanager.map.GoogleMapsActivity$5.run(GoogleMapsActivity.java:284)
                                                                                            at com.aayaffe.sailingracecoursemanager.map.GoogleMapsActivity.onStart(GoogleMapsActivity.java:407)
                                                                                            at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1234)
                                                                                            at android.app.Activity.performStart(Activity.java:6258)
                                                                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2621)
                                                                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2723) 
                                                                                            at android.app.ActivityThread.access$900(ActivityThread.java:172) 
                                                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422) 
                                                                                            at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                            at android.os.Looper.loop(Looper.java:145) 
                                                                                            at android.app.ActivityThread.main(ActivityThread.java:5832) 
                                                                                            at java.lang.reflect.Method.invoke(Native Method) 
                                                                                            at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) 
                                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) </p>
</blockquote>

<p>Ideas?</p>

<p>--EDITED--</p>

<p>Code:</p>

<pre><code>public enum ObjectTypes {
  Gate,
  Other
}     
FirebaseDatabase.getInstance().getReferenceFromUrl(c.getString(R.string.firebase_base_url)).child("test").setValue(ObjectTypes.Gate);
</code></pre>